Adds regex_equal/regex_not_equal #120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Is this pull request associated with an issue(s)?
Closes #119.
Description
Huge thanks to @josephgarnier for the implementation!
This PR adds two new asserts,
ct_assert_regex_equalandct_assert_regex_not_equal, that can be used to assert that a regex matches/does not match the contents of a variable.To clarify a bit,
ct_assert_equal/ct_assert_not_equalwill not work with a regex, so we needed to either extendct_assert_equal/ct_assert_not_equalto support toggling how the comparison is done or create new functions that are hard-coded to the correct comparison. We opted for the latter since it changes a significant portion of thect_assert_equal/ct_assert_not_equalimplementation.TODOs