Skip to content

Commit

Permalink
🎨 安全文件读写不再重试
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 21, 2023
1 parent 8b28e5a commit eaa7fdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions file_test.go
Expand Up @@ -138,6 +138,9 @@ func TestWriteFileSaferWithoutChangeTime(t *testing.T) {
}
modTime3 := info.ModTime()
t.Logf("file mod time [%v]", modTime3)
if modTime2 == modTime3 {
t.Errorf("mod time should not be changed")
}
}

func TestWriteFileSafer(t *testing.T) {
Expand All @@ -152,7 +155,6 @@ func TestWriteFileSafer(t *testing.T) {
if nil != err {
t.Fatalf("stat file [%s] failed: %s", writePath, err)
}
modTime1 := info.ModTime()

if err = File.WriteFileSafer(writePath, []byte("test"), 0644); nil != err {
t.Errorf("write file [%s] failed: %s", writePath, err)
Expand All @@ -163,9 +165,7 @@ func TestWriteFileSafer(t *testing.T) {
t.Fatalf("stat file [%s] failed: %s", writePath, err)
}
modTime2 := info.ModTime()
if modTime1 == modTime2 {
t.Errorf("mod time should not be changed")
}
t.Logf("file mod time [%v]", modTime2)
}

func TestIsHidden(t *testing.T) {
Expand Down

0 comments on commit eaa7fdb

Please sign in to comment.