mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-30 18:26:28 +08:00
test: remove unstable test item
This commit is contained in:
@@ -20,7 +20,7 @@ func TestToFormat(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestToFormat")
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@ func TestToFormatForTpl(t *testing.T) {
|
||||
assert.IsNotNil(err)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ func TestToIso8601(t *testing.T) {
|
||||
assert.IsNotNil(err)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -247,16 +247,16 @@ func ExampleFileSize() {
|
||||
// <nil>
|
||||
}
|
||||
|
||||
func ExampleMTime() {
|
||||
mtime, err := MTime("./testdata/test.txt")
|
||||
// func ExampleMTime() {
|
||||
// mtime, err := MTime("./testdata/test.txt")
|
||||
|
||||
fmt.Println(mtime)
|
||||
fmt.Println(err)
|
||||
// fmt.Println(mtime) // 1682478195 (unix timestamp)
|
||||
// fmt.Println(err)
|
||||
|
||||
// Output:
|
||||
// 1682478195
|
||||
// <nil>
|
||||
}
|
||||
// // Output:
|
||||
// // 1682478195
|
||||
// // <nil>
|
||||
// }
|
||||
|
||||
func ExampleSha() {
|
||||
sha1, err := Sha("./testdata/test.txt", 1)
|
||||
|
||||
@@ -267,9 +267,9 @@ func TestMTime(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestMTime")
|
||||
|
||||
mtime, err := MTime("./testdata/test.txt")
|
||||
|
||||
t.Log("TestMTime", mtime)
|
||||
assert.IsNil(err)
|
||||
assert.Equal(int64(1682478195), mtime)
|
||||
// assert.Equal(int64(1682478195), mtime)
|
||||
}
|
||||
|
||||
func TestSha(t *testing.T) {
|
||||
|
||||
@@ -68,15 +68,15 @@ func TestExecCommand(t *testing.T) {
|
||||
assert.IsNotNil(err)
|
||||
}
|
||||
|
||||
func TestExecCommandWithOption(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestExecCommand")
|
||||
// func TestExecCommandWithOption(t *testing.T) {
|
||||
// assert := internal.NewAssert(t, "TestExecCommandWithOption")
|
||||
|
||||
stdout, stderr, err := ExecCommand("ls", WithForeground())
|
||||
t.Log("std out: ", stdout)
|
||||
t.Log("std err: ", stderr)
|
||||
assert.Equal("", stderr)
|
||||
assert.IsNil(err)
|
||||
}
|
||||
// stdout, stderr, err := ExecCommand("ls", WithForeground())
|
||||
// t.Log("std out: ", stdout)
|
||||
// t.Log("std err: ", stderr)
|
||||
// assert.Equal("", stderr)
|
||||
// assert.IsNil(err)
|
||||
// }
|
||||
|
||||
func TestGetOsBits(t *testing.T) {
|
||||
osBits := GetOsBits()
|
||||
|
||||
Reference in New Issue
Block a user