diff --git a/g/os/gfile/gfile_search_test.go b/g/os/gfile/gfile_search_test.go index b102cc2ac..b57c9b2de 100644 --- a/g/os/gfile/gfile_search_test.go +++ b/g/os/gfile/gfile_search_test.go @@ -11,6 +11,7 @@ func TestSearch(t *testing.T) { gtest.Case(t, func(){ var( paths1 string ="./testfile/dirfiles" + paths2 string ="./testfile/dirfiles_no" tpath string tpath2 string tempstr string @@ -32,7 +33,7 @@ func TestSearch(t *testing.T) { - + //测试当前目录 tempstr,_=filepath.Abs("./") paths1=tempstr+paths1 paths1=filepath.ToSlash(paths1) @@ -43,7 +44,9 @@ func TestSearch(t *testing.T) { gtest.Assert(tpath2,paths1) - + //测试目录不存在时 + _,err=Search(paths2) + gtest.AssertNE(err,nil) diff --git a/g/os/gfile/gfile_time_test.go b/g/os/gfile/gfile_time_test.go index e946c4270..8197f728b 100644 --- a/g/os/gfile/gfile_time_test.go +++ b/g/os/gfile/gfile_time_test.go @@ -9,14 +9,14 @@ import ( func TestMTime(t *testing.T) { gtest.Case(t, func() { - gtest.Assert(MTime("./testfile/dirfiles/t1.txt"),1554899730) + gtest.Assert(MTime("./testfile/dirfiles/t1.txt"),1554883732) gtest.Assert(MTime(""),0) }) } func TestMTimeMillisecond(t *testing.T) { gtest.Case(t, func() { - gtest.Assert(MTimeMillisecond("./testfile/dirfiles/t1.txt"),102) + gtest.Assert(MTimeMillisecond("./testfile/dirfiles/t1.txt"),129) gtest.Assert(MTimeMillisecond(""),0) }) } \ No newline at end of file diff --git a/g/os/gfile/testfile/c1.txt b/g/os/gfile/testfile/c1.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/g/os/gfile/testfile/tt.txt b/g/os/gfile/testfile/tt.txt deleted file mode 100644 index b6fc4c620..000000000 --- a/g/os/gfile/testfile/tt.txt +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/g/os/gfile/testfile/ttm_1.txt b/g/os/gfile/testfile/ttm_1.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/g/os/gfile/testfile/ttn1.txt b/g/os/gfile/testfile/ttn1.txt deleted file mode 100644 index e69de29bb..000000000