Skip to content

Commit 8d7e27c

Browse files
committed
<feat>: 新增生成test部分;<fix>: 修改了new的_test部分
1 parent 2d00e3c commit 8d7e27c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tool/tests/test_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ func TestTest(t *testing.T) {
2424
"--file", "nonexist.go",
2525
})
2626
err := testCmd.Execute()
27-
assert.ErrorContains(t, err, "The system cannot find the file specified.")
27+
assert.Error(t, err)
28+
assert.True(t,
29+
strings.Contains(err.Error(), "The system cannot find the file specified") ||
30+
strings.Contains(err.Error(), "no such file or directory"),
31+
"错误消息不匹配",
32+
)
2833
})
2934
}

0 commit comments

Comments
 (0)