orangain / json-fuzzy-match

Custom assertion to check whether a JSON string fuzzily matches a pattern for JVM languages.
MIT License
13 stars 0 forks source link

Empty object literal must not match non-object values #8

Closed orangain closed 1 year ago

orangain commented 1 year ago

Empty object literal must not match non-object values.

Environment

Expected behavior

All the of following assertions fail.

JsonStringAssert.assertThat("[]").jsonMatches("{}")
JsonStringAssert.assertThat("0").jsonMatches("{}")
JsonStringAssert.assertThat("\"foo\"").jsonMatches("{}")
JsonStringAssert.assertThat("null").jsonMatches("{}")

Actual behavior

All of the following assertions succeed.

JsonStringAssert.assertThat("[]").jsonMatches("{}")
JsonStringAssert.assertThat("0").jsonMatches("{}")
JsonStringAssert.assertThat("\"foo\"").jsonMatches("{}")
JsonStringAssert.assertThat("null").jsonMatches("{}")