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

Sorted: Tests for sorted match expressions do not catch if you always compare to the first arm #66

Open
hnorkowski opened this issue Jul 27, 2023 · 0 comments

Comments

@hnorkowski
Copy link

hnorkowski commented Jul 27, 2023

In sorted::check I forgot to update the last arm and ended comparing all arms with the first arm but still all tests (1-8) passed.

I only noticed my error because I was wondering why test 8 did not fail when having an arm that started with a lower case char (lower chase char > "-") before actually impl. it

EDIT:
For test 8 it also would be a good idea to use match arms that start with a lower case letter (e.g. io::Result) because otherwise the order is correct anyways because all upper case chars are less than "_". At least if you use string comparison.

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

No branches or pull requests

1 participant