diff options
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"); +} |
