Skip to content

Commit 429cdfb

Browse files
committed
test: add modtime write testcase
1 parent bf4aa13 commit 429cdfb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

memfs/memory_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ func TestModTime(t *testing.T) {
6565

6666
// new calls to ModTime() retain existing mod time.
6767
assert.Equal(t, modtime, fi1a.ModTime())
68+
69+
// Writing to to file should change the mod time
70+
util.WriteFile(fs, "/file1", []byte{0}, 0o666)
71+
fi1c, err := fs.Stat("/file1")
72+
assert.NotEqual(t, modtime, fi1c.ModTime())
6873
}
6974

7075
func TestNegativeOffsets(t *testing.T) {

0 commit comments

Comments
 (0)