aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/html/escape/ut/escape_ut.cpp
blob: 436f3b6a2830845b6b82a1391b93eecf00376403 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <library/cpp/html/escape/escape.h>
#include <library/cpp/testing/unittest/registar.h>
 
using namespace NHtml; 
 
Y_UNIT_TEST_SUITE(TEscapeHtml) {
    Y_UNIT_TEST(Escape) {
        UNIT_ASSERT_EQUAL(EscapeText("in & out"), "in &amp; out"); 
        UNIT_ASSERT_EQUAL(EscapeText("&&"), "&amp;&amp;"); 
        UNIT_ASSERT_EQUAL(EscapeText("&amp;"), "&amp;amp;"); 
 
        UNIT_ASSERT_EQUAL(EscapeText("<script>"), "&lt;script&gt;"); 
 
        UNIT_ASSERT_EQUAL(EscapeText("text"), "text"); 
    } 
}