Skip to content

Should fail when characters added after json closing tags #113

@m-sroka

Description

@m-sroka

JSONCompare.compareJSON("{}", "{}", JSONCompareMode.STRICT)._success -> true
JSONCompare.compareJSON("{}", "{}a", JSONCompareMode.STRICT)._success -> true
JSONCompare.compareJSON("{}a", "{}", JSONCompareMode.STRICT)._success -> true
JSONCompare.compareJSON("{}b", "{}a", JSONCompareMode.STRICT)._success -> true

Same when root of json is array:
JSONCompare.compareJSON("[]", "[]a", JSONCompareMode.STRICT)._success -> true

Same with non-empty jsons:
JSONCompare.compareJSON("{'a': 1}", "{'a': 1}a", JSONCompareMode.STRICT)._success -> true

When characters are before json opening tags then it's ok:
JSONCompare.compareJSON("{}", "a{}", JSONCompareMode.STRICT) -> throws org.json.JSONException
JSONCompare.compareJSON("[]", "a[]", JSONCompareMode.STRICT) -> throws org.json.JSONException

Also ok with nested objects/arrays:
JSONCompare.compareJSON("[{'a': 'b'}a]", "[{'a': 'b'}]", JSONCompareMode.STRICT) -> throws org.json.JSONException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions