| 1 | #include <cgreen/cgreen.h> |
| 2 | #include <cgreen/constraint_syntax_helpers.h> |
| 3 | |
| 4 | Ensure(failing_test_is_listed_by_xml_reporter) { |
| 5 | assert_that(false); |
| 6 | } |
| 7 | |
| 8 | Ensure(passing_test_is_listed_by_xml_reporter) { |
| 9 | assert_that(true); |
| 10 | } |
| 11 | |
| 12 | Ensure(percent_in_value_is_not_treated_as_format_directive_by_xml_reporter) { |
| 13 | assert_that("a literal %d should survive", contains_string("absent")); |
| 14 | } |
| 15 | |
| 16 | Ensure(error_message_gets_escaped_by_xml_reporter) { |
| 17 | char *test_string = |
| 18 | "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n" |
| 19 | "<example name=\"arbitrary xml content\">\n" |
| 20 | " <content>I'm the content & have chars which have to be escaped, " |
| 21 | "if put in outer XML.</content>\n" |
| 22 | "</example>"; |
| 23 | char *expected_string = "I'm not to be found!"; |
| 24 | assert_that(test_string, contains_string(expected_string)); |
| 25 | } |