Skip to content

Commit 91d1820

Browse files
committed
Commit some touchups
1 parent 76b9c5a commit 91d1820

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

suites/scopes.json

+12
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,17 @@
5151
{ "name": "Jesse Keller", "department": "Engineering" },
5252
{ "name": "Mason Sullivan", "department": "Engineering" }
5353
]
54+
},
55+
"The specification below depends upon escaping from another proposal",
56+
{
57+
"description": "Access an escaped key from above",
58+
"rule": {
59+
"map": [
60+
{ "var": "arr" },
61+
{ "+": [{ "var": "../../\\.\\./" }, { "var": "../../..\\/" }]}
62+
]
63+
},
64+
"data": { "arr": [1,2,3], "../": 10, "": { "": { "/": 7 }} },
65+
"result": [17,17,17]
5466
}
5567
]

suites/vars.json

+36
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"data": { "" : { "": { "": 3 } } },
1919
"result": 3
2020
},
21+
{
22+
"description": "Fetches a value from a key that is purely a dot",
23+
"rule": { "var": "\\." },
24+
"data": { "." : 20 },
25+
"result": 20
26+
},
2127
{
2228
"description": "Fetches a value from a key with a dot in it",
2329
"rule": { "var": "\\.key" },
@@ -41,5 +47,35 @@
4147
"rule": { "var": "..\\.key." },
4248
"data": { "": { "": { ".key": { "": 7 }} }},
4349
"result": 7
50+
},
51+
{
52+
"description": "Escape / as well, which is useful for the scope proposal",
53+
"rule": { "var": "\\/" },
54+
"data": { "/" : 8 },
55+
"result": 8
56+
},
57+
{
58+
"description": "Though / doesn't inherently need to be escaped",
59+
"rule": { "var": "/" },
60+
"data": { "/" : 9 },
61+
"result": 9
62+
},
63+
{
64+
"description": "Dot then empty key",
65+
"rule": { "var": "\\.." },
66+
"data": { "." : { "" : 10 } },
67+
"result": 10
68+
},
69+
{
70+
"description": "Empty key then dot",
71+
"rule": { "var": ".\\." },
72+
"data": { "" : { "." : 11 } },
73+
"result": 11
74+
},
75+
{
76+
"description": "Can use backslack in name, too",
77+
"rule": { "var": "\\\\.Hello" },
78+
"data": { "\\" : { "Hello" : 12 } },
79+
"result": 12
4480
}
4581
]

0 commit comments

Comments
 (0)