test/test_jsonpath.rb in iso-jsonpath-1.1.6 vs test/test_jsonpath.rb in iso-jsonpath-1.1.7
- old
+ new
@@ -590,9 +590,29 @@
]
}
assert_equal([{ 'with space' => 'urn:1' }], JsonPath.new("$.store[?(@['with space'])]").on(jsonld))
end
+ def test_hash_in_filter
+ jsonld = {
+ 'store' => [
+ { 'withouthash' => 'urn' },
+ { 'with #' => 'urn:1' }
+ ]
+ }
+ assert_equal([{ 'with #' => 'urn:1' }], JsonPath.new("$.store[?(@['with #'])]").on(jsonld))
+ end
+
+ def test_quote_in_filter
+ jsonld = {
+ 'store' => [
+ { 'withoutquote' => 'urn' },
+ { 'with \'' => 'urn:1' }
+ ]
+ }
+ assert_equal([{ 'with \'' => 'urn:1' }], JsonPath.new("$.store[?(@['with \''])]").on(jsonld))
+ end
+
def test_at_in_value
jsonld = {
'mentions' =>
{
'name' => 'Delimara Powerplant',