1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-11 16:22:26 +08:00

fix: fix failed unit test

This commit is contained in:
dudaodong
2023-12-11 15:45:02 +08:00
parent 96320069f4
commit 0b976e9a4c
4 changed files with 6 additions and 14 deletions

View File

@@ -14,12 +14,6 @@ func TestTryUnwrap(t *testing.T) {
assert := internal.NewAssert(t, "TestTryUnwrap")
assert.Equal(42, TryUnwrap(strconv.Atoi("42")))
}
func TestTryUnwrapFail(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestTryUnwrapFail")
_, err := strconv.Atoi("4o2")
defer func() {
@@ -76,8 +70,6 @@ func TestXError_Unwrap(t *testing.T) {
}
func TestXError_StackTrace(t *testing.T) {
// t.Parallel()
assert := internal.NewAssert(t, "TestXError_StackTrace")
err := New("error")
@@ -86,7 +78,7 @@ func TestXError_StackTrace(t *testing.T) {
assert.Equal(3, len(stacks))
assert.Equal("github.com/duke-git/lancet/v2/xerror.TestXError_StackTrace", stacks[0].Func)
assert.Equal(83, stacks[0].Line)
assert.Equal(75, stacks[0].Line)
assert.Equal(true, strings.Contains(stacks[0].File, "xerror_test.go"))
}