Skip to content

Conversation

@ryanmrichard
Copy link
Contributor

@ryanmrichard ryanmrichard commented Jun 9, 2025

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_equal and ct_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_equal will not work with a regex, so we needed to either extend ct_assert_equal/ct_assert_not_equal to 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 the ct_assert_equal/ct_assert_not_equal implementation.

TODOs

@ryanmrichard ryanmrichard requested a review from zachcran June 9, 2025 17:29
@ryanmrichard ryanmrichard self-assigned this Jun 9, 2025
Copy link
Contributor

@zachcran zachcran left a comment

Choose a reason for hiding this comment

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

LGTM, except for a few documentation tweaks.

Co-authored-by: Zachery Crandall <zachcran@gmail.com>
@josephgarnier
Copy link

@ryanmrichard Thanks for the quick integration! Looks great.

zachcran
zachcran previously approved these changes Jun 9, 2025
Copy link
Contributor

@zachcran zachcran left a comment

Choose a reason for hiding this comment

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

LGTM

@ryanmrichard ryanmrichard merged commit d5ae33d into master Jun 9, 2025
7 checks passed
@ryanmrichard ryanmrichard deleted the regex_equal branch June 9, 2025 20:51
@github-actions
Copy link

github-actions bot commented Jun 9, 2025

🚀 [bumpr] Bumped!
New version:v0.1.20
Changes:v0.1.19...v0.1.20

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.

Support for 'true_false' assert with RegEx

4 participants