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

tests: offer exact name matching with a $ suffix #5537

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

ethomson
Copy link
Member

@ethomson ethomson commented Jun 2, 2020

When using -s to specify a particular test, it will do a prefix match.
Thus, -sapply::both::rename_a_to_b_to_c will match both a test named
test_apply_both__rename_a_to_b_to_c and a test that begins with that
name, like test_apply_both__rename_a_to_b_to_c_exact.

Permit a trailing $ to -s syntax. This allows a user to specify
-sapply::both::rename_a_to_b_to_c$ to match only the
test_apply_both__rename_a_to_b_to_c function.

We already filter to ensure that the given prefix matches the current
test name. Also ensure that the length of the test name matches the
length of the filter, sans trailing $.

Fixes clar-test/clar#83

When using `-s` to specify a particular test, it will do a prefix match.
Thus, `-sapply::both::rename_a_to_b_to_c` will match both a test named
`test_apply_both__rename_a_to_b_to_c` and a test that begins with that
name, like `test_apply_both__rename_a_to_b_to_c_exact`.

Permit a trailing `$` to `-s` syntax.  This allows a user to specify
`-sapply::both::rename_a_to_b_to_c$` to match _only_ the
`test_apply_both__rename_a_to_b_to_c` function.

We already filter to ensure that the given prefix matches the current
test name.  Also ensure that the length of the test name matches the
length of the filter, sans trailing `$`.
Copy link
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, makes sense to me and works as advertised! 👍

@pks-t pks-t merged commit 86b8549 into master Jun 3, 2020
@ethomson ethomson deleted the ethomson/clar_exactmatch branch December 11, 2020 14:32
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.

Specifier for a precise match using -s
2 participants