24 #include "gtest/gtest.h" 28 std::string MakeRandomString(
size_t len) {
29 std::random_device rd;
30 std::mt19937 gen(rd());
31 std::uniform_int_distribution<> dis(
'a',
'z');
32 std::string s(len,
'0');
39 TEST(FormatExtensionTest, SinkAppendSubstring) {
40 for (
size_t chunk_size : {1, 10, 100, 1000, 10000}) {
41 std::string expected, actual;
43 for (
size_t chunks = 0; chunks < 10; ++chunks) {
44 std::string rand = MakeRandomString(chunk_size);
49 EXPECT_EQ(actual, expected);
53 TEST(FormatExtensionTest, SinkAppendChars) {
54 for (
size_t chunk_size : {1, 10, 100, 1000, 10000}) {
55 std::string expected, actual;
57 for (
size_t chunks = 0; chunks < 10; ++chunks) {
58 std::string rand = MakeRandomString(1);
59 expected.append(chunk_size, rand[0]);
60 sink.Append(chunk_size, rand[0]);
63 EXPECT_EQ(actual, expected);
TEST(Symbolize, Unimplemented)