From cd719f134df92b4980fa31a105c54dc596b3276b Mon Sep 17 00:00:00 2001 From: jroam Date: Thu, 11 Apr 2019 09:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=87=E8=BE=BE=E5=88=B082?= =?UTF-8?q?.9%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/os/gfile/gfile_search_test.go | 7 +++++-- g/os/gfile/gfile_time_test.go | 4 ++-- g/os/gfile/testfile/c1.txt | 0 g/os/gfile/testfile/tt.txt | 1 - g/os/gfile/testfile/ttm_1.txt | 0 g/os/gfile/testfile/ttn1.txt | 0 6 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 g/os/gfile/testfile/c1.txt delete mode 100644 g/os/gfile/testfile/tt.txt delete mode 100644 g/os/gfile/testfile/ttm_1.txt delete mode 100644 g/os/gfile/testfile/ttn1.txt 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