test verbose error message
This commit is contained in:
parent
32b51949b7
commit
965234694e
@ -273,8 +273,7 @@ func TestErrorMessage(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestErrorVerbose(t *testing.T) {
|
func TestErrorVerbose(t *testing.T) {
|
||||||
const expected = `
|
const expected = `<input>:5:2:parse failed, parsing: string`
|
||||||
`
|
|
||||||
|
|
||||||
const doc = `{
|
const doc = `{
|
||||||
"a":1,
|
"a":1,
|
||||||
@ -295,5 +294,9 @@ func TestErrorVerbose(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Log(perr.Error())
|
if perr.Error() != expected {
|
||||||
|
t.Error("failed to get the right error message")
|
||||||
|
t.Log("got: ", perr.Error())
|
||||||
|
t.Log("expected:", expected)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user