Skip to content

Commit ebd2d30

Browse files
committed
Imported legacy compliance tests from jmespath.py repository.
1 parent 17f57e1 commit ebd2d30

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

tests/legacy/legacy_literal.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[
2+
{
3+
"given": {
4+
"foo": [{"name": "a"}, {"name": "b"}],
5+
"bar": {"baz": "qux"}
6+
},
7+
"cases": [
8+
{
9+
"expression": "`foo`",
10+
"result": "foo"
11+
},
12+
{
13+
"comment": "Double quotes must be escaped.",
14+
"expression": "`foo\\\"quote`",
15+
"result": "foo\"quote"
16+
},
17+
{
18+
"expression": "`✓`",
19+
"result": ""
20+
},
21+
{
22+
"comment": "Double quote in literal",
23+
"expression": "`foo\\\"bar`",
24+
"result": "foo\"bar"
25+
},
26+
{
27+
"expression": "`1\\``",
28+
"result": "1`"
29+
},
30+
{
31+
"comment": "Multiple literal expressions with escapes",
32+
"expression": "`\\\\`.{a:`b`}",
33+
"result": {"a": "b"}
34+
}
35+
]
36+
},
37+
{
38+
"comment": "Literals",
39+
"given": {"type": "object"},
40+
"cases": [
41+
{
42+
"expression": "`foo`",
43+
"result": "foo"
44+
},
45+
{
46+
"expression": "` foo`",
47+
"result": "foo"
48+
},
49+
{
50+
"comment": "Literal on RHS of subexpr not allowed",
51+
"expression": "foo.`bar`",
52+
"error": "syntax"
53+
}
54+
]
55+
}
56+
]

0 commit comments

Comments
 (0)