diff --git a/tests/multiselect.json b/tests/multiselect.json index 4f46482..8eb46da 100644 --- a/tests/multiselect.json +++ b/tests/multiselect.json @@ -31,6 +31,10 @@ "expression": "foo.{bar: bar}", "result": {"bar": "bar"} }, + { + "expression": "foo.{bar}", + "result": {"bar": "bar"} + }, { "expression": "foo.{\"bar\": bar}", "result": {"bar": "bar"} @@ -43,6 +47,10 @@ "expression": "foo.{bar: bar, baz: baz}", "result": {"bar": "bar", "baz": "baz"} }, + { + "expression": "foo.{bar, baz}", + "result": {"bar": "bar", "baz": "baz"} + }, { "expression": "foo.{\"bar\": bar, \"baz\": baz}", "result": {"bar": "bar", "baz": "baz"} @@ -67,6 +75,10 @@ "expression": "foo.{noexist: noexist, alsonoexist: alsonoexist}", "result": {"noexist": null, "alsonoexist": null} }, + { + "expression": "foo.{noexist, alsonoexist}", + "result": {"noexist": null, "alsonoexist": null} + }, { "expression": "foo.badkey.{nokey: nokey, alsonokey: alsonokey}", "result": null @@ -77,6 +89,12 @@ {"a": "first", "b": "second"}, {"a": "first", "b": "second"}] }, + { + "expression": "foo.nested.*.{a,b}", + "result": [{"a": "first", "b": "second"}, + {"a": "first", "b": "second"}, + {"a": "first", "b": "second"}] + }, { "expression": "foo.nested.three.{a: a, cinner: c.inner}", "result": {"a": "first", "cinner": "third"} @@ -135,6 +153,10 @@ "expression": "foo.{bar:bar,baz:baz}", "result": {"bar": 1, "baz": [2, 3, 4]} }, + { + "expression": "foo.{bar,baz}", + "result": {"bar": 1, "baz": [2, 3, 4]} + }, { "expression": "foo.[bar,baz[0]]", "result": [1, 2] diff --git a/tests/syntax.json b/tests/syntax.json index 9318901..9c74803 100644 --- a/tests/syntax.json +++ b/tests/syntax.json @@ -412,9 +412,9 @@ "error": "syntax" }, { - "comment": "Not a key-value pair", + "comment": "Valid single-key multi-select hash extraction", "expression": "a.{foo}", - "error": "syntax" + "result": null }, { "comment": "Valid multi-select hash extraction",