We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 368ca91 commit 2de9242Copy full SHA for 2de9242
tests/host/fs/test_fs.inc
@@ -161,6 +161,19 @@ TEST_CASE(TESTPRE "truncate", TESTPAT)
161
REQUIRE( s == "some" );
162
}
163
164
+TEST_CASE(TESTPRE "open(w+) truncates file", TESTPAT)
165
+{
166
+ FS_MOCK_DECLARE(64, 8, 512, "");
167
+ REQUIRE(FSTYPE.begin());
168
+ createFile("/file1", "some text");
169
+ String s = readFile("/file1");
170
+ REQUIRE( s == "some text");
171
+ auto f = FSTYPE.open("/file1", "w+");
172
+ f.close();
173
+ String t = readFile("/file1");
174
+ REQUIRE( t == "");
175
+}
176
+
177
#ifdef FS_HAS_DIRS
178
179
#if FSTYPE != SDFS
0 commit comments