1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
{
"Nested Structures" :
{
"level": 5,
"variables": {
"list" : ["one", "two", "three", "four"],
"dict" : {"semi": ";", "dot": ".", "comma": ","},
"lists" : [["one", "two"], ["three"], "four"],
"dicts" : {"one": {"semi": ";", "dot": "."}, "two": {"comma": ","}},
"mixed" : {"list": ["one", ["two", "three"]], "dict": {"one": {"semi": ";", "dot": "."}, "two": {"comma": ","}}},
"dlist" : [{"semi": ";", "dot": "."}, {"comma": ","}]
},
"testcases" : [
["{list}", "one,two,three,four"],
["{list*}", "one,two,three,four"],
["{?list}", "?list=one,two,three,four"],
["{?list*}", "?list=one&list=two&list=three&list=four"],
["{lists}", "one,two,three,four"],
["{lists*}", "one,two,three,four"],
["{?lists}", "?lists=one,two,three,four"],
["{?lists*}", "?lists=one&lists=two&lists=three&lists=four"],
["{dict}", [
"comma,%2C,dot,.,semi,%3B",
"comma,%2C,semi,%3B,dot,.",
"dot,.,comma,%2C,semi,%3B",
"dot,.,semi,%3B,comma,%2C",
"semi,%3B,comma,%2C,dot,.",
"semi,%3B,dot,.,comma,%2C"
]],
["{dict*}", [
"comma=%2C,dot=.,semi=%3B",
"comma=%2C,semi=%3B,dot=.",
"dot=.,comma=%2C,semi=%3B",
"dot=.,semi=%3B,comma=%2C",
"semi=%3B,comma=%2C,dot=.",
"semi=%3B,dot=.,comma=%2C"
]],
["{?dict}", [
"?dict=comma,%2C,dot,.,semi,%3B",
"?dict=comma,%2C,semi,%3B,dot,.",
"?dict=dot,.,comma,%2C,semi,%3B",
"?dict=dot,.,semi,%3B,comma,%2C",
"?dict=semi,%3B,comma,%2C,dot,.",
"?dict=semi,%3B,dot,.,comma,%2C"
]],
["{?dict*}", [
"?comma=%2C&dot=.&semi=%3B",
"?comma=%2C&semi=%3B&dot=.",
"?dot=.&comma=%2C&semi=%3B",
"?dot=.&semi=%3B&comma=%2C",
"?semi=%3B&comma=%2C&dot=.",
"?semi=%3B&dot=.&comma=%2C"
]],
["{dicts}", [
"two.comma,%2C,one.dot,.,one.semi,%3B",
"two.comma,%2C,one.semi,%3B,one.dot,.",
"one.dot,.,two.comma,%2C,one.semi,%3B",
"one.dot,.,one.semi,%3B,two.comma,%2C",
"one.semi,%3B,two.comma,%2C,one.dot,.",
"one.semi,%3B,one.dot,.,two.comma,%2C"
]],
["{dicts*}", [
"two.comma=%2C,one.dot=.,one.semi=%3B",
"two.comma=%2C,one.semi=%3B,one.dot=.",
"one.dot=.,two.comma=%2C,one.semi=%3B",
"one.dot=.,one.semi=%3B,two.comma=%2C",
"one.semi=%3B,two.comma=%2C,one.dot=.",
"one.semi=%3B,one.dot=.,two.comma=%2C"
]],
["{?dicts}", [
"?dicts=two.comma,%2C,one.dot,.,one.semi,%3B",
"?dicts=two.comma,%2C,one.semi,%3B,one.dot,.",
"?dicts=one.dot,.,two.comma,%2C,one.semi,%3B",
"?dicts=one.dot,.,one.semi,%3B,two.comma,%2C",
"?dicts=one.semi,%3B,two.comma,%2C,one.dot,.",
"?dicts=one.semi,%3B,one.dot,.,two.comma,%2C"
]],
["{?dicts*}", [
"?two.comma=%2C&one.dot=.&one.semi=%3B",
"?two.comma=%2C&one.semi=%3B&one.dot=.",
"?one.dot=.&two.comma=%2C&one.semi=%3B",
"?one.dot=.&one.semi=%3B&two.comma=%2C",
"?one.semi=%3B&two.comma=%2C&one.dot=.",
"?one.semi=%3B&one.dot=.&two.comma=%2C"
]],
["{mixed}", [
"list.one,list.two,list.three,dict.two.comma,%2C,dict.one.dot,.,dict.one.semi,%3B",
"list.one,list.two,list.three,dict.two.comma,%2C,dict.one.semi,%3B,dict.one.dot,.",
"list.one,list.two,list.three,dict.one.dot,.,dict.two.comma,%2C,dict.one.semi,%3B",
"list.one,list.two,list.three,dict.one.dot,.,dict.one.semi,%3B,dict.two.comma,%2C",
"list.one,list.two,list.three,dict.one.semi,%3B,dict.two.comma,%2C,dict.one.dot,.",
"list.one,list.two,list.three,dict.one.semi,%3B,dict.one.dot,.,dict.two.comma,%2C"
]],
["{mixed*}", [
"list.one,list.two,list.three,dict.two.comma=%2C,dict.one.dot=.,dict.one.semi=%3B",
"list.one,list.two,list.three,dict.two.comma=%2C,dict.one.semi=%3B,dict.one.dot=.",
"list.one,list.two,list.three,dict.one.dot=.,dict.two.comma=%2C,dict.one.semi=%3B",
"list.one,list.two,list.three,dict.one.dot=.,dict.one.semi=%3B,dict.two.comma=%2C",
"list.one,list.two,list.three,dict.one.semi=%3B,dict.two.comma=%2C,dict.one.dot=.",
"list.one,list.two,list.three,dict.one.semi=%3B,dict.one.dot=.,dict.two.comma=%2C"
]],
["{?mixed}", [
"?mixed=list.one,list.two,list.three,dict.two.comma,%2C,dict.one.dot,.,dict.one.semi,%3B",
"?mixed=list.one,list.two,list.three,dict.two.comma,%2C,dict.one.semi,%3B,dict.one.dot,.",
"?mixed=list.one,list.two,list.three,dict.one.dot,.,dict.two.comma,%2C,dict.one.semi,%3B",
"?mixed=list.one,list.two,list.three,dict.one.dot,.,dict.one.semi,%3B,dict.two.comma,%2C",
"?mixed=list.one,list.two,list.three,dict.one.semi,%3B,dict.two.comma,%2C,dict.one.dot,.",
"?mixed=list.one,list.two,list.three,dict.one.semi,%3B,dict.one.dot,.,dict.two.comma,%2C"
]],
["{?mixed*}", [
"?list=one&list=two&list=three&dict.two.comma=%2C&dict.one.dot=.&dict.one.semi=%3B",
"?list=one&list=two&list=three&dict.two.comma,%2C&dict.one.semi=%3B&dict.one.dot=.",
"?list=one&list=two&list=three&dict.one.dot=.&dict.two.comma=%2C&dict.one.semi=%3B",
"?list=one&list=two&list=three&dict.one.dot=.&dict.one.semi=%3B&dict.two.comma=%2C",
"?list=one&list=two&list=three&dict.one.semi=%3B&dict.two.comma=%2C&dict.one.dot=.",
"?list=one&list=two&list=three&dict.one.semi=%3B&dict.one.dot=.&dict.two.comma=%2C"
]],
["{dlist}", [
"dot,.,semi,%3B,comma,%2C",
"semi,%3B,dot,.,comma,%2C"
]],
["{dlist*}", [
"dot=.,semi=%3B,comma=%2C",
"semi=%3B,dot=.,comma=%2C"
]],
["{?dlist}", [
"?dlist=dot,.,semi,%3B,comma,%2C",
"?dlist=semi,%3B,dot,.,comma,%2C"
]],
["{?dlist*}", [
"?dlist.dot=.&dlist.semi=%3B&dlist.comma=%2C",
"?dlist.semi=%3B&dlist.dot=.&dlist.comma=%2C"
]]
]
},
"Array Modifier" :
{
"level": 5,
"variables": {
"list" : ["one", "two", "three", "four"],
"dict" : {"semi": ";", "dot": ".", "comma": ","},
"lists" : [["one", "two"], ["three"], "four"],
"dicts" : {"one": {"semi": ";", "dot": "."}, "two": {"comma": ","}},
"mixed" : {"list": ["one", ["two", "three"]], "dict": {"one": {"semi": ";", "dot": "."}, "two": {"comma": ","}}},
"dlist" : [{"semi": ";", "dot": "."}, {"comma": ","}]
},
"testcases" : [
["{list[]}", "one,two,three,four"],
["{?list[]}", "?list[0]=one&list[1]=two&list[2]=three&list[3]=four"],
["{lists[]}", "one,two,three,four"],
["{?lists[]}", "?lists[0][0]=one&lists[0][1]=two&lists[1][0]=three&lists[2]=four"],
["{dict[]}", [
"comma=%2C,dot=.,semi=%3B",
"comma=%2C,semi=%3B,dot=.",
"dot=.,comma=%2C,semi=%3B",
"dot=.,semi=%3B,comma=%2C",
"semi=%3B,comma=%2C,dot=.",
"semi=%3B,dot=.,comma=%2C"
]],
["{?dict[]}", [
"?comma=%2C&dot=.&semi=%3B",
"?comma=%2C&semi=%3B&dot=.",
"?dot=.&comma=%2C&semi=%3B",
"?dot=.&semi=%3B&comma=%2C",
"?semi=%3B&comma=%2C&dot=.",
"?semi=%3B&dot=.&comma=%2C"
]],
["{dicts[]}", [
"two[comma]=%2C,one[dot]=.,one[semi]=%3B",
"two[comma]=%2C,one[semi]=%3B,one[dot]=.",
"one[dot]=.,two[comma]=%2C,one[semi]=%3B",
"one[dot]=.,one[semi]=%3B,two[comma]=%2C",
"one[semi]=%3B,two[comma]=%2C,one[dot]=.",
"one[semi]=%3B,one[dot]=.,two[comma]=%2C"
]],
["{?dicts[]}", [
"?two[comma]=%2C&one[dot]=.&one[semi]=%3B",
"?two[comma]=%2C&one[semi]=%3B&one[dot]=.",
"?one[dot]=.&two[comma]=%2C&one[semi]=%3B",
"?one[dot]=.&one[semi]=%3B&two[comma]=%2C",
"?one[semi]=%3B&two[comma]=%2C&one[dot]=.",
"?one[semi]=%3B&one[dot]=.&two[comma]=%2C"
]],
["{mixed[]}", [
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[two][comma]=%2C,dict[one][dot]=.,dict[one][semi]=%3B",
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[two][comma]=%2C,dict[one][semi]=%3B,dict[one][dot]=.",
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[one][dot]=.,dict[two][comma]=%2C,dict[one][semi]=%3B",
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[one][dot]=.,dict[one][semi]=%3B,dict[two][comma]=%2C",
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[one][semi]=%3B,dict[two][comma]=%2C,dict[one][dot]=.",
"list[0]=one,list[1][0]=two,list[1][1]=three,dict[one][semi]=%3B,dict[one][dot]=.,dict[two][comma]=%2C"
]],
["{?mixed[]}", [
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[two][comma]=%2C&dict[one][dot]=.&dict[one][semi]=%3B",
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[two][comma]=%2C&dict[one][semi]=%3B&dict[one][dot]=.",
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[one][dot]=.&dict[two][comma]=%2C&dict[one][semi]=%3B",
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[one][dot]=.&dict[one][semi]=%3B&dict[two][comma]=%2C",
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[one][semi]=%3B&dict[two][comma]=%2C&dict[one][dot]=.",
"?list[0]=one&list[1][0]=two&list[1][1]=three&dict[one][semi]=%3B&dict[one][dot]=.&dict[two][comma]=%2C"
]],
["{dlist[]}", [
"dot=.,semi=%3B,comma=%2C",
"semi=%3B,dot=.,comma=%2C"
]],
["{?dlist[]}", [
"?dlist[0][dot]=.&dlist[0][semi]=%3B&dlist[1][comma]=%2C",
"?dlist[0][semi]=%3B&dlist[0][dot]=.&dlist[1][comma]=%2C"
]]
]
}
}
|