test verbose error message

This commit is contained in:
Arpad Ryszka 2017-12-29 15:39:12 +01:00
parent 32b51949b7
commit 965234694e

View File

@ -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)
}
} }