diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-20 20:59:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-20 20:59:28 +0100 |
| commit | 2fa6122a3cfa0e801f4a36b39f50e0bf7d575e4b (patch) | |
| tree | b8de41fec71f78debe97ee9fcdd8dc3be65f9b45 /test/shared_subtitle_test.cc | |
| parent | ec87fa55c5909ae85429fc5344469cf284e5f6b3 (diff) | |
fixup! Nearly pretty-print subtitle XML (though not in <Text> nodes).2205-subtitle-formatting
Diffstat (limited to 'test/shared_subtitle_test.cc')
| -rw-r--r-- | test/shared_subtitle_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/shared_subtitle_test.cc b/test/shared_subtitle_test.cc index 2231d631..ae05642a 100644 --- a/test/shared_subtitle_test.cc +++ b/test/shared_subtitle_test.cc @@ -205,3 +205,15 @@ BOOST_AUTO_TEST_CASE (format_xml_test2) check_xml (dcp::file_to_string(private_test / "DKH_UT_EN20160601def.reformatted.xml"), dcp::SubtitleAsset::format_xml(*document, {}), {}); } + +BOOST_AUTO_TEST_CASE (format_xml_entities_test) +{ + xmlpp::Document doc; + auto root = doc.create_root_node("Foo"); + root->add_child("Bar")->add_child_text("Don't panic & xml \"is\" 'great' & < > —"); + BOOST_REQUIRE_EQUAL(dcp::SubtitleAsset::format_xml(doc, {}), +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<Foo>\n" +" <Bar>Don't panic &amp; xml \"is\" 'great' & < > —</Bar>\n" +"</Foo>\n"); +} |
