diff --git a/test/format-test.cc b/test/format-test.cc index 14ff1b52..95ca2dc2 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -267,6 +267,16 @@ TEST(ArrayTest, Append) { EXPECT_EQ(15u, array.capacity()); } +TEST(ArrayTest, AppendAllocatesEnoughStorage) { + Array array; + const char *test = "abcdefgh"; + array.resize(10); + array.append(test, test + 9); + EXPECT_STREQ("test", &array[10]); + EXPECT_EQ(19u, array.size()); + EXPECT_EQ(19u, array.capacity()); +} + TEST(WriterTest, Ctor) { Writer w; EXPECT_EQ(0u, w.size());