openMSX
XMLEscape_test.cc
Go to the documentation of this file.
1 #include "catch.hpp"
2 #include "XMLEscape.hh"
3 
4 TEST_CASE("XMLEscape")
5 {
6  SECTION("1 special char") {
7  CHECK(XMLEscape("<") == "&lt;");
8  }
9  SECTION("data + char") {
10  CHECK(XMLEscape("foobar>") == "foobar&gt;");
11  }
12  SECTION("char + data") {
13  CHECK(XMLEscape("&foobar") == "&amp;foobar");
14  }
15  SECTION("char + data + char") {
16  CHECK(XMLEscape("'foobar\"") == "&apos;foobar&quot;");
17  }
18  SECTION("data + char + data") {
19  CHECK(XMLEscape("foo\007bar") == "foo&#x07;bar");
20  }
21 }
void XMLEscape(std::string_view s, Output output)
Definition: XMLEscape.hh:21
TEST_CASE("XMLEscape")
CHECK(m3==m3)