Skip to content

Commit 3a862d9

Browse files
committed
Moved JEP-12 compliant tests to their own folder as per the specification.
1 parent 6ac021c commit 3a862d9

File tree

5 files changed

+364
-287
lines changed

5 files changed

+364
-287
lines changed

bin/jp-compliance

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class ComplianceTestRunner(object):
196196
failure_message = (
197197
"\nFAIL {category},{group_number},{test_number}\n"
198198
"The expression: {expression}\n"
199-
"was suppose to give: {result}\n"
199+
"was supposed to give: {result}\n"
200200
"for the JSON: {given_js}\n"
201201
"but instead gave: {actual}\n"
202202
).format(**test_case)
@@ -208,7 +208,7 @@ class ComplianceTestRunner(object):
208208
failure_message = (
209209
"\nFAIL {category},{group_number},{test_number}\n"
210210
"The expression: {expression}\n"
211-
"was suppose to have non zero for error error: {error}\n"
211+
"was supposed to have non zero for error error: {error}\n"
212212
"but instead gave rc of: {returncode}, stderr: \n{stderr}\n"
213213
).format(**test_case)
214214
sys.stdout.write(failure_message)
@@ -218,7 +218,7 @@ class ComplianceTestRunner(object):
218218
failure_message = (
219219
"\nFAIL {category},{group_number},{test_number}\n"
220220
"The expression: {expression}\n"
221-
"was suppose to emit the error: {error}\n"
221+
"was supposed to emit the error: {error}\n"
222222
"but instead gave: \n{stderr}\n"
223223
).format(**test_case)
224224
sys.stdout.write(failure_message)

tests/jep-12/jep-12-literal.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[
2+
{
3+
"comment": "Literals",
4+
"given": {
5+
"type": "object"
6+
},
7+
"cases": [
8+
{
9+
"expression": "`foo`",
10+
"error": "syntax"
11+
},
12+
{
13+
"comment": "Literal with non-JSON whitespace U+0085 NEXT LINE",
14+
"expression": "`0\u0085`",
15+
"error": "syntax"
16+
},
17+
{
18+
"comment": "Literal with non-JSON whitespace U+00A0 NO-BREAK SPACE",
19+
"expression": "`0\u00A0`",
20+
"error": "syntax"
21+
},
22+
{
23+
"comment": "Literal with non-JSON whitespace U+1680 OGHAM SPACE MARK",
24+
"expression": "`0\u1680`",
25+
"error": "syntax"
26+
},
27+
{
28+
"comment": "Literal with non-JSON whitespace U+2028 LINE SEPARATOR",
29+
"expression": "`0\u2028`",
30+
"error": "syntax"
31+
},
32+
{
33+
"comment": "Literal with non-JSON whitespace U+3000 IDEOGRAPHIC SPACE",
34+
"expression": "`0\u3000`",
35+
"error": "syntax"
36+
}
37+
]
38+
}
39+
]

tests/legacy/legacy-literal.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
[
2+
{
3+
"given": {
4+
"foo": [
5+
{
6+
"name": "a"
7+
},
8+
{
9+
"name": "b"
10+
}
11+
],
12+
"bar": {
13+
"baz": "qux"
14+
}
15+
},
16+
"cases": [
17+
{
18+
"expression": "`foo`",
19+
"result": "foo"
20+
},
21+
{
22+
"comment": "Double quotes must be escaped.",
23+
"expression": "`foo\\\"quote`",
24+
"result": "foo\"quote"
25+
},
26+
{
27+
"expression": "`✓`",
28+
"result": ""
29+
},
30+
{
31+
"comment": "Double quote in literal",
32+
"expression": "`foo\\\"bar`",
33+
"result": "foo\"bar"
34+
},
35+
{
36+
"expression": "`1\\``",
37+
"result": "1`"
38+
},
39+
{
40+
"comment": "Multiple literal expressions with escapes",
41+
"expression": "`\\\\`.{a:`b`}",
42+
"result": {
43+
"a": "b"
44+
}
45+
}
46+
]
47+
},
48+
{
49+
"comment": "Literals",
50+
"given": {
51+
"type": "object"
52+
},
53+
"cases": [
54+
{
55+
"expression": "`foo`",
56+
"result": "foo"
57+
},
58+
{
59+
"expression": "` foo`",
60+
"result": "foo"
61+
},
62+
{
63+
"comment": "Literal on RHS of subexpr not allowed",
64+
"expression": "foo.`bar`",
65+
"error": "syntax"
66+
},
67+
{
68+
"comment": "Literal with non-JSON whitespace U+0085 NEXT LINE",
69+
"expression": "`0\u0085`",
70+
"result": "0\u0085"
71+
},
72+
{
73+
"comment": "Literal with non-JSON whitespace U+00A0 NO-BREAK SPACE",
74+
"expression": "`0\u00A0`",
75+
"result": "0\u00A0"
76+
},
77+
{
78+
"comment": "Literal with non-JSON whitespace U+1680 OGHAM SPACE MARK",
79+
"expression": "`0\u1680`",
80+
"result": "0\u1680"
81+
},
82+
{
83+
"comment": "Literal with non-JSON whitespace U+2028 LINE SEPARATOR",
84+
"expression": "`0\u2028`",
85+
"result": "0\u2028"
86+
},
87+
{
88+
"comment": "Literal with non-JSON whitespace U+3000 IDEOGRAPHIC SPACE",
89+
"expression": "`0\u3000`",
90+
"result": "0\u3000"
91+
}
92+
]
93+
}
94+
]

tests/legacy/legacy_literal.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)