Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sequnce validator for with sorted = True #2271

Merged
merged 2 commits into from Oct 12, 2020

Conversation

jenshnielsen
Copy link
Collaborator

sorted(Sequence) always returns a list so the previous comparison would be incorrect if the input sequence is not a list.

This fixes that by always casting to a tuple on both sides.

Also add some basic tests for the sequence validator that was missing

to work correctly with other sequence types than list
@codecov
Copy link

codecov bot commented Oct 12, 2020

Codecov Report

Merging #2271 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2271      +/-   ##
==========================================
+ Coverage   71.83%   71.85%   +0.01%     
==========================================
  Files         154      154              
  Lines       20647    20647              
==========================================
+ Hits        14832    14835       +3     
+ Misses       5815     5812       -3     

@jenshnielsen jenshnielsen merged commit 53bbf08 into microsoft:master Oct 12, 2020
@jenshnielsen jenshnielsen deleted the fix_sorted_validator branch October 12, 2020 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants