# HG changeset patch # User Kim Alvefur # Date 1666182073 -7200 # Node ID 4d5549de27e69c9492182625854b5b7214f230e2 # Parent 4715301a35048a24240b75311a00b4efc3d819ec util.jsonpointer: Improve tests Result of mutation testing Remaining mutants are mostly relating to the math.type() fallback. Another case being that array[#array+1] == array[#array+2] and thus doesn't matter. diff -r 4715301a3504 -r 4d5549de27e6 spec/util_jsonpointer_spec.lua --- a/spec/util_jsonpointer_spec.lua Wed Oct 19 14:07:48 2022 +0200 +++ b/spec/util_jsonpointer_spec.lua Wed Oct 19 14:21:13 2022 +0200 @@ -21,9 +21,11 @@ }]]) end) it("works", function() + assert.is_nil(jp.resolve("string", "/string")) assert.same(example, jp.resolve(example, "")); assert.same({ "bar", "baz" }, jp.resolve(example, "/foo")); assert.same("bar", jp.resolve(example, "/foo/0")); + assert.same(nil, jp.resolve(example, "/foo/-")); assert.same(0, jp.resolve(example, "/")); assert.same(1, jp.resolve(example, "/a~1b")); assert.same(2, jp.resolve(example, "/c%d"));