summaryrefslogtreecommitdiff
path: root/unittests/Support/raw_ostream_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Support/raw_ostream_test.cpp')
-rw-r--r--unittests/Support/raw_ostream_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/Support/raw_ostream_test.cpp b/unittests/Support/raw_ostream_test.cpp
index 52639ba7a2..bd2e95cbb5 100644
--- a/unittests/Support/raw_ostream_test.cpp
+++ b/unittests/Support/raw_ostream_test.cpp
@@ -117,4 +117,14 @@ TEST(raw_ostreamTest, BufferEdge) {
EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 10));
}
+TEST(raw_ostreamTest, TinyBuffer) {
+ std::string Str;
+ raw_string_ostream OS(Str);
+ OS.SetBufferSize(1);
+ OS << "hello";
+ OS << 1;
+ OS << 'w' << 'o' << 'r' << 'l' << 'd';
+ EXPECT_EQ("hello1world", OS.str());
+}
+
}