diff options
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
| -rw-r--r-- | Source/UnitTests/Common/StringUtilTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp index b9b186c131..fe837be455 100644 --- a/Source/UnitTests/Common/StringUtilTest.cpp +++ b/Source/UnitTests/Common/StringUtilTest.cpp @@ -105,3 +105,13 @@ TEST(StringUtil, ToString_TryParse_Roundtrip) DoRoundTripTest<float>({0.0f, 1.0f, -1.0f, -0.5f, 0.5f, -1e-3f, 1e-3f, 1e3f, -1e3f}); DoRoundTripTest<double>({0.0, 1.0, -1.0, -0.5, 0.5, -1e-3, 1e-3, 1e3, -1e3}); } + +TEST(StringUtil, GetEscapedHtml) +{ + static constexpr auto no_escape_needed = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + "!@#$%^*()-_=+,./?;:[]{}| \\\t\n"; + EXPECT_EQ(GetEscapedHtml(no_escape_needed), no_escape_needed); + EXPECT_EQ(GetEscapedHtml("&<>'\""), "&<>'""); + EXPECT_EQ(GetEscapedHtml("&&&"), "&&&"); +} |
