Make buffer size configurable

This commit is contained in:
Victor Zverovich
2020-08-01 10:25:39 -07:00
parent f0b84da5ff
commit 7c4c5c79d2
3 changed files with 74 additions and 12 deletions

View File

@@ -305,6 +305,14 @@ TEST(OStreamTest, BufferBoundary) {
EXPECT_READ(in, str + str);
}
TEST(OStreamTest, BufferSize) {
fmt::ostream out = fmt::output_file("test-file", fmt::buffer_size=1);
out.print("{}", "foo");
out.close();
file in("test-file", file::RDONLY);
EXPECT_READ(in, "foo");
}
TEST(FileTest, DefaultCtor) {
file f;
EXPECT_EQ(-1, f.descriptor());