Drop the raw_ostream required buffer size to 1.
[oota-llvm.git] / unittests / Support / raw_ostream_test.cpp
index 52639ba7a2f9faa303e559239c260a53874ea9ca..bd2e95cbb531418b7e9fb46fa4fe127497ae9432 100644 (file)
@@ -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());
+}
+
 }