summaryrefslogtreecommitdiff
path: root/unittests/Support
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-10-23 14:19:52 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-10-23 14:19:52 +0000
commit4a142eb28942073eb27a112b5ca1cca3f01beb9c (patch)
tree22cc59e4b240d84c3a5a60531119c4eca914a256 /unittests/Support
parent5cd822fa9bbb9622241e3bf4d7674ed49ccde5b9 (diff)
downloadsrc-test2-4a142eb28942073eb27a112b5ca1cca3f01beb9c.tar.gz
src-test2-4a142eb28942073eb27a112b5ca1cca3f01beb9c.zip
Notes
Diffstat (limited to 'unittests/Support')
-rw-r--r--unittests/Support/raw_ostream_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/unittests/Support/raw_ostream_test.cpp b/unittests/Support/raw_ostream_test.cpp
index bd2e95cbb531..2b797b43666b 100644
--- a/unittests/Support/raw_ostream_test.cpp
+++ b/unittests/Support/raw_ostream_test.cpp
@@ -127,4 +127,20 @@ TEST(raw_ostreamTest, TinyBuffer) {
EXPECT_EQ("hello1world", OS.str());
}
+TEST(raw_ostreamTest, WriteEscaped) {
+ std::string Str;
+
+ Str = "";
+ raw_string_ostream(Str).write_escaped("hi");
+ EXPECT_EQ("hi", Str);
+
+ Str = "";
+ raw_string_ostream(Str).write_escaped("\\\t\n\"");
+ EXPECT_EQ("\\\\\\t\\n\\\"", Str);
+
+ Str = "";
+ raw_string_ostream(Str).write_escaped("\1\10\200");
+ EXPECT_EQ("\\001\\010\\200", Str);
+}
+
}