escape_ut.cpp 500 B

12345678910111213141516
  1. #include <library/cpp/html/escape/escape.h>
  2. #include <library/cpp/testing/unittest/registar.h>
  3. using namespace NHtml;
  4. Y_UNIT_TEST_SUITE(TEscapeHtml) {
  5. Y_UNIT_TEST(Escape) {
  6. UNIT_ASSERT_EQUAL(EscapeText("in & out"), "in &amp; out");
  7. UNIT_ASSERT_EQUAL(EscapeText("&&"), "&amp;&amp;");
  8. UNIT_ASSERT_EQUAL(EscapeText("&amp;"), "&amp;amp;");
  9. UNIT_ASSERT_EQUAL(EscapeText("<script>"), "&lt;script&gt;");
  10. UNIT_ASSERT_EQUAL(EscapeText("text"), "text");
  11. }
  12. }