fdefelici / clove-unit

Single-Header Unit Testing framework for C (interoperable with C++) with test autodiscovery feature
MIT License
46 stars 9 forks source link

Assertion: Add Regex assert for string #85

Open fdefelici opened 10 months ago

fdefelici commented 10 months ago

Could be useful for integration testing when you have no control over logic preparing the string and exists some parts that are not deterministic.

This also could be used for improving clove-unit integration testing where the non-deterministic part is the test duration.

Api example:

CLOVE_STRING_REGEX(expected_with_regex, actual)

If expected_with_regex doesn't contain any regex, this should behave like CLOVE_STRING_EQ.

Related to #44