Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/Progmasoft
diff options
context:
space:
mode:
authorLeitwolf2026-10-29 12:18:33 +0300
committerGitHub2026-10-29 12:18:33 +0300
commit1d48419b7ef642917ebf7dfd16c3bc1b3050d8f1 (patch)
tree2e3327fb973f9560b5067d654f3a21ff12a821aa /tests/Progmasoft
parentd2e3e074bb2e1b8ffd9fc990d0b87667ea602f58 (diff)
parent30176b75937e87eafbb4f5557eb0be9697753ddf (diff)
downloadcatch3-1d48419b7ef642917ebf7dfd16c3bc1b3050d8f1.tar.gz
Merge pull request #19 from Progmasoft/feature/yyjson-pugixml
Read and write JSON with yyjson and JUnit XML with pugixml
Diffstat (limited to 'tests/Progmasoft')
-rw-r--r--tests/Progmasoft/Results.tests.cpp13
-rw-r--r--tests/Progmasoft/Runner.tests.cpp2
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/Progmasoft/Results.tests.cpp b/tests/Progmasoft/Results.tests.cpp
index fc37caff..ad52d311 100644
--- a/tests/Progmasoft/Results.tests.cpp
+++ b/tests/Progmasoft/Results.tests.cpp
@@ -190,7 +190,7 @@ TEST_CASE("JUnit XML keeps every attempt and marks flaky tests",
CHECK(xml.rfind("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", 0) == 0);
CHECK(xml.find("tests=\"4\" failures=\"1\" errors=\"1\" skipped=\"1\"") !=
std::string::npos);
- CHECK(xml.find("name=\"reports &lt;errors&gt;\"") != std::string::npos);
+ CHECK(xml.find("name=\"reports &lt;errors>\"") != std::string::npos);
CHECK(xml.find("classname=\"ParserTests\"") != std::string::npos);
CHECK(xml.find("<failure message=\"parser.cpp:7: FAILED:\" "
"type=\"assertion\">") != std::string::npos);
@@ -202,9 +202,9 @@ TEST_CASE("JUnit XML keeps every attempt and marks flaky tests",
"type=\"crash\">") != std::string::npos);
CHECK(xml.find("<flakyFailure message=\"timed out after 5.0 s\" "
"type=\"timeout\">") != std::string::npos);
- CHECK(xml.find("<skipped message=\"depends on &apos;reports &lt;errors&gt;"
- "&apos;, which failed\"/>") != std::string::npos);
- CHECK(xml.find("<property name=\"random-seed\" value=\"42\"/>") !=
+ CHECK(xml.find("<skipped message=\"depends on 'reports &lt;errors>', "
+ "which failed\" />") != std::string::npos);
+ CHECK(xml.find("<property name=\"random-seed\" value=\"42\" />") !=
std::string::npos);
CHECK(xml.find("time=\"0.263500\"") != std::string::npos);
CHECK(xml.ends_with("</testsuites>\n"));
@@ -220,9 +220,10 @@ TEST_CASE("JUnit XML replaces malformed UTF-8 and forbidden XML controls",
run.tests.push_back(test);
const std::string xml = JUnitXmlWriter::ToString(run);
- CHECK(xml.find("name=\"bad&#xFFFD;utf8&#xFFFD;(&#xFFFD;(\"") !=
+ // U+FFFD, written as the character itself.
+ CHECK(xml.find("name=\"bad\xEF\xBF\xBDutf8\xEF\xBF\xBD(\xEF\xBF\xBD(\"") !=
std::string::npos);
- CHECK(xml.find("name=\"suite&#xFFFD;name\"") != std::string::npos);
+ CHECK(xml.find("name=\"suite\xEF\xBF\xBDname\"") != std::string::npos);
}
TEST_CASE("The JUnit writer reports a failed stream", "[progmasoft][results][xml]")
diff --git a/tests/Progmasoft/Runner.tests.cpp b/tests/Progmasoft/Runner.tests.cpp
index ff0cfb1a..2c97de4e 100644
--- a/tests/Progmasoft/Runner.tests.cpp
+++ b/tests/Progmasoft/Runner.tests.cpp
@@ -285,7 +285,7 @@ TEST_CASE("JUnit and trace outputs are written", "[progmasoft][runner]")
CHECK(ExitCode(run) == 0);
auto xml = Runner::ReadFile(junit);
REQUIRE(xml);
- CHECK_THAT(*xml, ContainsSubstring("<skipped message=\"skipped\"/>"));
+ CHECK_THAT(*xml, ContainsSubstring("<skipped message=\"skipped\" />"));
auto traceText = Runner::ReadFile(trace);
REQUIRE(traceText);
auto traceJson = Runner::ParseJson(*traceText);