mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
DoTestCaseFile: Don't panic
Instead of panicking, report the error in the form,
$file: $msg
So an error might look like,
foo.txt: line 12: invalid case No: [..]
And then kill the test with FailNow.
This is the same as calling `t.Fatalf(...)`.
This commit is contained in:
parent
282e1428bc
commit
86794e96ee
1 changed files with 2 additions and 1 deletions
|
|
@ -236,7 +236,8 @@ func ParseTestCaseFile(filename string) ([]MarkdownTestCase, error) {
|
|||
func DoTestCaseFile(m goldmark.Markdown, filename string, t TestingT, no ...int) {
|
||||
allCases, err := ParseTestCaseFile(filename)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
t.Errorf("%v: %v", filename, err)
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
cases := allCases[:0]
|
||||
|
|
|
|||
Loading…
Reference in a new issue