[ADT] Add unit test for PrintHTMLEscaped

Add unit tests for PrintHTMLEscaped which was added in r333565.

llvm-svn: 333590
This commit is contained in:
Jonas Devlieghere 2018-05-30 20:47:18 +00:00
parent 2600c63d96
commit 50603518a0
1 changed files with 7 additions and 0 deletions

View File

@ -92,3 +92,10 @@ TEST(StringExtrasTest, printLowerCase) {
printLowerCase("ABCdefg01234.,&!~`'}\"", OS);
EXPECT_EQ("abcdefg01234.,&!~`'}\"", OS.str());
}
TEST(StringExtrasTest, PrintHTMLEscaped) {
std::string str;
raw_string_ostream OS(str);
PrintHTMLEscaped("ABCdef123&<>\"'", OS);
EXPECT_EQ("ABCdef123&amp;&lt;&gt;&quot;&apos;", OS.str());
}