Closed phm07 closed 5 months ago
YAMLEq does not check if passed strings have valid YAML syntax. This leads to the following test passing:
YAMLEq
func TestYAML(t *testing.T) { json := `{ "foo": "bar", "baz": 42 }` assert.YAMLEq(t, json, json) }
This is useful for the expected parameter, because it allows to check against JSON schemas, but IMO actual should be validated.
expected
actual
Hi!
as far as I know json is a valid yaml syntax reference
and for the code itself, it use yaml library and it return error when actual or expected is not a valid yaml based on the lib
yaml
so your case here is expected, hope this helps... cheers!
YAMLEq
does not check if passed strings have valid YAML syntax. This leads to the following test passing:This is useful for the
expected
parameter, because it allows to check against JSON schemas, but IMOactual
should be validated.