Truncate file by default
This commit is contained in:
1 parent
22a68d1613
commit
119f7dc3d6
2 files changed
+16
-2
No files matched your search
@@ -319,6 +319,19 @@ TEST(OStreamTest, BufferSize) {
|
||||
EXPECT_READ(in, "foo");
|
||||
}
|
||||
|
||||
TEST(OStreamTest, Truncate) {
|
||||
{
|
||||
fmt::ostream out = fmt::output_file("test-file");
|
||||
out.print("0123456789");
|
||||
}
|
||||
{
|
||||
fmt::ostream out = fmt::output_file("test-file");
|
||||
out.print("foo");
|
||||
}
|
||||
file in("test-file", file::RDONLY);
|
||||
EXPECT_EQ("foo", read(in, 4));
|
||||
}
|
||||
|
||||
TEST(FileTest, DefaultCtor) {
|
||||
file f;
|
||||
EXPECT_EQ(-1, f.descriptor());
|
||||
|
||||
Reference in new issue
Block a user