Every test for failure in test-values-and-matchers.c assumes that assert_that outputs text of the form
Failed assertion
Expected: the short -32768
Actual: the short 32767
which means that the text "Failed assertion", "Expected: ", and "Actual: " appears in a string in about half of the tests in values-and-matchers.c. This tight coupling is against the spirit of testing separate units separately.
Since test-assert-that.c already verifies that assert_that works by invoking pfstest_matcher_matches(), pfstest_matcher_print(), and pfstest_value_print(), we can use these API calls directly in test-values-and-matchers.c to make these tests cleaner. For example:
Every test for failure in test-values-and-matchers.c assumes that assert_that outputs text of the form
which means that the text "Failed assertion", "Expected: ", and "Actual: " appears in a string in about half of the tests in values-and-matchers.c. This tight coupling is against the spirit of testing separate units separately.
Since test-assert-that.c already verifies that assert_that works by invoking pfstest_matcher_matches(), pfstest_matcher_print(), and pfstest_value_print(), we can use these API calls directly in test-values-and-matchers.c to make these tests cleaner. For example: