improve temporary path producing from gfile.Join to gfile.TempDir

This commit is contained in:
John
2020-03-28 00:41:12 +08:00
parent f1f575fd5c
commit ddcb7121c1
17 changed files with 47 additions and 47 deletions

View File

@ -44,8 +44,8 @@ func Test_Gzip_UnGzip(t *testing.T) {
func Test_Gzip_UnGzip_File(t *testing.T) {
srcPath := gdebug.TestDataPath("gzip", "file.txt")
dstPath1 := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr(), "gzip.zip")
dstPath2 := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr(), "file.txt")
dstPath1 := gfile.TempDir(gtime.TimestampNanoStr(), "gzip.zip")
dstPath2 := gfile.TempDir(gtime.TimestampNanoStr(), "file.txt")
// Compress.
gtest.C(t, func(t *gtest.T) {

View File

@ -29,7 +29,7 @@ func Test_ZipPath(t *testing.T) {
t.Assert(gfile.Exists(dstPath), true)
defer gfile.Remove(dstPath)
tempDirPath := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr())
tempDirPath := gfile.TempDir(gtime.TimestampNanoStr())
err = gfile.Mkdir(tempDirPath)
t.Assert(err, nil)
@ -58,7 +58,7 @@ func Test_ZipPath(t *testing.T) {
t.Assert(gfile.Exists(dstPath), true)
defer gfile.Remove(dstPath)
tempDirPath := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr())
tempDirPath := gfile.TempDir(gtime.TimestampNanoStr())
err = gfile.Mkdir(tempDirPath)
t.Assert(err, nil)
@ -93,7 +93,7 @@ func Test_ZipPath(t *testing.T) {
t.Assert(gfile.Exists(dstPath), true)
defer gfile.Remove(dstPath)
tempDirPath := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr())
tempDirPath := gfile.TempDir(gtime.TimestampNanoStr())
err = gfile.Mkdir(tempDirPath)
t.Assert(err, nil)
@ -131,7 +131,7 @@ func Test_ZipPathWriter(t *testing.T) {
t.Assert(err, nil)
t.AssertGT(writer.Len(), 0)
tempDirPath := gfile.Join(gfile.TempDir(), gtime.TimestampNanoStr())
tempDirPath := gfile.TempDir(gtime.TimestampNanoStr())
err = gfile.Mkdir(tempDirPath)
t.Assert(err, nil)