test: remove unstable test item

This commit is contained in:
dudaodong
2023-04-26 18:14:27 +08:00
parent 42ec189995
commit 99cb1b13a3
4 changed files with 23 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ func TestToFormat(t *testing.T) {
assert := internal.NewAssert(t, "TestToFormat") assert := internal.NewAssert(t, "TestToFormat")
tm, err := NewFormat("2022-03-18 17:04:05") tm, err := NewFormat("2022-03-18 17:04:05")
assert.Equal("2022-03-18 17:04:05", tm.ToFormat()) t.Log("TestToFormat", tm.ToFormat())
assert.IsNil(err) assert.IsNil(err)
} }
@@ -31,7 +31,8 @@ func TestToFormatForTpl(t *testing.T) {
assert.IsNotNil(err) assert.IsNotNil(err)
tm, err := NewFormat("2022-03-18 17:04:05") tm, err := NewFormat("2022-03-18 17:04:05")
assert.Equal("2022/03/18 17:04:05", tm.ToFormatForTpl("2006/01/02 15:04:05")) // assert.Equal("2022/03/18 17:04:05", tm.ToFormatForTpl("2006/01/02 15:04:05"))
t.Log("TestToFormatForTpl", tm.ToFormatForTpl("2006/01/02 15:04:05"))
assert.IsNil(err) assert.IsNil(err)
} }
@@ -42,6 +43,7 @@ func TestToIso8601(t *testing.T) {
assert.IsNotNil(err) assert.IsNotNil(err)
tm, err := NewISO8601("2006-01-02T15:04:05.999Z") tm, err := NewISO8601("2006-01-02T15:04:05.999Z")
assert.Equal("2006-01-02T23:04:05+08:00", tm.ToIso8601()) t.Log("TestToIso8601", tm.ToIso8601())
// assert.Equal("2006-01-02T23:04:05+08:00", tm.ToIso8601())
assert.IsNil(err) assert.IsNil(err)
} }

View File

@@ -247,16 +247,16 @@ func ExampleFileSize() {
// <nil> // <nil>
} }
func ExampleMTime() { // func ExampleMTime() {
mtime, err := MTime("./testdata/test.txt") // mtime, err := MTime("./testdata/test.txt")
fmt.Println(mtime) // fmt.Println(mtime) // 1682478195 (unix timestamp)
fmt.Println(err) // fmt.Println(err)
// Output: // // Output:
// 1682478195 // // 1682478195
// <nil> // // <nil>
} // }
func ExampleSha() { func ExampleSha() {
sha1, err := Sha("./testdata/test.txt", 1) sha1, err := Sha("./testdata/test.txt", 1)

View File

@@ -267,9 +267,9 @@ func TestMTime(t *testing.T) {
assert := internal.NewAssert(t, "TestMTime") assert := internal.NewAssert(t, "TestMTime")
mtime, err := MTime("./testdata/test.txt") mtime, err := MTime("./testdata/test.txt")
t.Log("TestMTime", mtime)
assert.IsNil(err) assert.IsNil(err)
assert.Equal(int64(1682478195), mtime) // assert.Equal(int64(1682478195), mtime)
} }
func TestSha(t *testing.T) { func TestSha(t *testing.T) {

View File

@@ -68,15 +68,15 @@ func TestExecCommand(t *testing.T) {
assert.IsNotNil(err) assert.IsNotNil(err)
} }
func TestExecCommandWithOption(t *testing.T) { // func TestExecCommandWithOption(t *testing.T) {
assert := internal.NewAssert(t, "TestExecCommand") // assert := internal.NewAssert(t, "TestExecCommandWithOption")
stdout, stderr, err := ExecCommand("ls", WithForeground()) // stdout, stderr, err := ExecCommand("ls", WithForeground())
t.Log("std out: ", stdout) // t.Log("std out: ", stdout)
t.Log("std err: ", stderr) // t.Log("std err: ", stderr)
assert.Equal("", stderr) // assert.Equal("", stderr)
assert.IsNil(err) // assert.IsNil(err)
} // }
func TestGetOsBits(t *testing.T) { func TestGetOsBits(t *testing.T) {
osBits := GetOsBits() osBits := GetOsBits()