We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d00e3c commit 8d7e27cCopy full SHA for 8d7e27c
1 file changed
tool/tests/test_test.go
@@ -24,6 +24,11 @@ func TestTest(t *testing.T) {
24
"--file", "nonexist.go",
25
})
26
err := testCmd.Execute()
27
- assert.ErrorContains(t, err, "The system cannot find the file specified.")
+ 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
+ )
33
34
}
0 commit comments