mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
improve temporary path producing from gfile.Join to gfile.TempDir
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user