-
-
Notifications
You must be signed in to change notification settings - Fork 550
/
Copy pathcanonical-data.json
419 lines (419 loc) · 17 KB
/
canonical-data.json
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
{
"exercise": "grep",
"comments": [
" JSON doesn't allow for multi-line strings, so all ",
" outputs are presented here as arrays of strings. ",
" It's up to the test generator to join the lines ",
" together with line breaks. ",
" ",
" The tests are divided into two groups: ",
" - Grepping a single file ",
" - Grepping multiple files at once ",
" ",
" The language track implementing this exercise ",
" should ensure that when the tests run, three files ",
" are created with the following contents. The file ",
" names and their contents are listed below: ",
" ",
" iliad.txt ",
" --------------------------------------------- ",
" |Achilles sing, O Goddess! Peleus' son; | ",
" |His wrath pernicious, who ten thousand woes| ",
" |Caused to Achaia's host, sent many a soul | ",
" |Illustrious into Ades premature, | ",
" |And Heroes gave (so stood the will of Jove)| ",
" |To dogs and to all ravening fowls a prey, | ",
" |When fierce dispute had separated once | ",
" |The noble Chief Achilles from the son | ",
" |Of Atreus, Agamemnon, King of men. | ",
" --------------------------------------------- ",
" ",
" midsummer-night.txt ",
" ----------------------------------------------- ",
" |I do entreat your grace to pardon me. | ",
" |I know not by what power I am made bold, | ",
" |Nor how it may concern my modesty, | ",
" |In such a presence here to plead my thoughts;| ",
" |But I beseech your grace that I may know | ",
" |The worst that may befall me in this case, | ",
" |If I refuse to wed Demetrius. | ",
" ----------------------------------------------- ",
" ",
" paradise-lost.txt ",
" ------------------------------------------------- ",
" |Of Mans First Disobedience, and the Fruit | ",
" |Of that Forbidden Tree, whose mortal tast | ",
" |Brought Death into the World, and all our woe, | ",
" |With loss of Eden, till one greater Man | ",
" |Restore us, and regain the blissful Seat, | ",
" |Sing Heav'nly Muse, that on the secret top | ",
" |Of Oreb, or of Sinai, didst inspire | ",
" |That Shepherd, who first taught the chosen Seed| ",
" ------------------------------------------------- "
],
"cases": [
{
"description": "Test grepping a single file",
"cases": [
{
"uuid": "9049fdfd-53a7-4480-a390-375203837d09",
"description": "One file, one match, no flags",
"property": "grep",
"input": {
"pattern": "Agamemnon",
"flags": [],
"files": ["iliad.txt"]
},
"expected": ["Of Atreus, Agamemnon, King of men."]
},
{
"uuid": "76519cce-98e3-46cd-b287-aac31b1d77d6",
"description": "One file, one match, print line numbers flag",
"property": "grep",
"input": {
"pattern": "Forbidden",
"flags": ["-n"],
"files": ["paradise-lost.txt"]
},
"expected": ["2:Of that Forbidden Tree, whose mortal tast"]
},
{
"uuid": "af0b6d3c-e0e8-475e-a112-c0fc10a1eb30",
"description": "One file, one match, case-insensitive flag",
"property": "grep",
"input": {
"pattern": "FORBIDDEN",
"flags": ["-i"],
"files": ["paradise-lost.txt"]
},
"expected": ["Of that Forbidden Tree, whose mortal tast"]
},
{
"uuid": "ff7af839-d1b8-4856-a53e-99283579b672",
"description": "One file, one match, print file names flag",
"property": "grep",
"input": {
"pattern": "Forbidden",
"flags": ["-l"],
"files": ["paradise-lost.txt"]
},
"expected": ["paradise-lost.txt"]
},
{
"uuid": "8625238a-720c-4a16-81f2-924ec8e222cb",
"description": "One file, one match, match entire lines flag",
"property": "grep",
"input": {
"pattern": "With loss of Eden, till one greater Man",
"flags": ["-x"],
"files": ["paradise-lost.txt"]
},
"expected": ["With loss of Eden, till one greater Man"]
},
{
"uuid": "2a6266b3-a60f-475c-a5f5-f5008a717d3e",
"description": "One file, one match, multiple flags",
"property": "grep",
"input": {
"pattern": "OF ATREUS, Agamemnon, KIng of MEN.",
"flags": ["-n", "-i", "-x"],
"files": ["iliad.txt"]
},
"expected": ["9:Of Atreus, Agamemnon, King of men."]
},
{
"uuid": "842222da-32e8-4646-89df-0d38220f77a1",
"description": "One file, several matches, no flags",
"property": "grep",
"input": {
"pattern": "may",
"flags": [],
"files": ["midsummer-night.txt"]
},
"expected": [
"Nor how it may concern my modesty,",
"But I beseech your grace that I may know",
"The worst that may befall me in this case,"
]
},
{
"uuid": "4d84f45f-a1d8-4c2e-a00e-0b292233828c",
"description": "One file, several matches, print line numbers flag",
"property": "grep",
"input": {
"pattern": "may",
"flags": ["-n"],
"files": ["midsummer-night.txt"]
},
"expected": [
"3:Nor how it may concern my modesty,",
"5:But I beseech your grace that I may know",
"6:The worst that may befall me in this case,"
]
},
{
"uuid": "0a483b66-315b-45f5-bc85-3ce353a22539",
"description": "One file, several matches, match entire lines flag",
"property": "grep",
"input": {
"pattern": "may",
"flags": ["-x"],
"files": ["midsummer-night.txt"]
},
"expected": []
},
{
"uuid": "3d2ca86a-edd7-494c-8938-8eeed1c61cfa",
"description": "One file, several matches, case-insensitive flag",
"property": "grep",
"input": {
"pattern": "ACHILLES",
"flags": ["-i"],
"files": ["iliad.txt"]
},
"expected": [
"Achilles sing, O Goddess! Peleus' son;",
"The noble Chief Achilles from the son"
]
},
{
"uuid": "1f52001f-f224-4521-9456-11120cad4432",
"description": "One file, several matches, inverted flag",
"property": "grep",
"input": {
"pattern": "Of",
"flags": ["-v"],
"files": ["paradise-lost.txt"]
},
"expected": [
"Brought Death into the World, and all our woe,",
"With loss of Eden, till one greater Man",
"Restore us, and regain the blissful Seat,",
"Sing Heav'nly Muse, that on the secret top",
"That Shepherd, who first taught the chosen Seed"
]
},
{
"uuid": "7a6ede7f-7dd5-4364-8bf8-0697c53a09fe",
"description": "One file, no matches, various flags",
"property": "grep",
"input": {
"pattern": "Gandalf",
"flags": ["-n", "-l", "-x", "-i"],
"files": ["iliad.txt"]
},
"expected": []
},
{
"uuid": "3d3dfc23-8f2a-4e34-abd6-7b7d140291dc",
"description": "One file, one match, file flag takes precedence over line flag",
"property": "grep",
"input": {
"pattern": "ten",
"flags": ["-n", "-l"],
"files": ["iliad.txt"]
},
"expected": ["iliad.txt"]
},
{
"uuid": "87b21b24-b788-4d6e-a68b-7afe9ca141fe",
"description": "One file, several matches, inverted and match entire lines flags",
"property": "grep",
"input": {
"pattern": "Illustrious into Ades premature,",
"flags": ["-x", "-v"],
"files": ["iliad.txt"]
},
"expected": [
"Achilles sing, O Goddess! Peleus' son;",
"His wrath pernicious, who ten thousand woes",
"Caused to Achaia's host, sent many a soul",
"And Heroes gave (so stood the will of Jove)",
"To dogs and to all ravening fowls a prey,",
"When fierce dispute had separated once",
"The noble Chief Achilles from the son",
"Of Atreus, Agamemnon, King of men."
]
}
]
},
{
"description": "Test grepping multiples files at once",
"cases": [
{
"uuid": "ba496a23-6149-41c6-a027-28064ed533e5",
"description": "Multiple files, one match, no flags",
"property": "grep",
"input": {
"pattern": "Agamemnon",
"flags": [],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": ["iliad.txt:Of Atreus, Agamemnon, King of men."]
},
{
"uuid": "4539bd36-6daa-4bc3-8e45-051f69f5aa95",
"description": "Multiple files, several matches, no flags",
"property": "grep",
"input": {
"pattern": "may",
"flags": [],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"midsummer-night.txt:Nor how it may concern my modesty,",
"midsummer-night.txt:But I beseech your grace that I may know",
"midsummer-night.txt:The worst that may befall me in this case,"
]
},
{
"uuid": "9fb4cc67-78e2-4761-8e6b-a4b57aba1938",
"description": "Multiple files, several matches, print line numbers flag",
"property": "grep",
"input": {
"pattern": "that",
"flags": ["-n"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"midsummer-night.txt:5:But I beseech your grace that I may know",
"midsummer-night.txt:6:The worst that may befall me in this case,",
"paradise-lost.txt:2:Of that Forbidden Tree, whose mortal tast",
"paradise-lost.txt:6:Sing Heav'nly Muse, that on the secret top"
]
},
{
"uuid": "aeee1ef3-93c7-4cd5-af10-876f8c9ccc73",
"description": "Multiple files, one match, print file names flag",
"property": "grep",
"input": {
"pattern": "who",
"flags": ["-l"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": ["iliad.txt", "paradise-lost.txt"]
},
{
"uuid": "d69f3606-7d15-4ddf-89ae-01df198e6b6c",
"description": "Multiple files, several matches, case-insensitive flag",
"property": "grep",
"input": {
"pattern": "TO",
"flags": ["-i"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"iliad.txt:Caused to Achaia's host, sent many a soul",
"iliad.txt:Illustrious into Ades premature,",
"iliad.txt:And Heroes gave (so stood the will of Jove)",
"iliad.txt:To dogs and to all ravening fowls a prey,",
"midsummer-night.txt:I do entreat your grace to pardon me.",
"midsummer-night.txt:In such a presence here to plead my thoughts;",
"midsummer-night.txt:If I refuse to wed Demetrius.",
"paradise-lost.txt:Brought Death into the World, and all our woe,",
"paradise-lost.txt:Restore us, and regain the blissful Seat,",
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top"
]
},
{
"uuid": "82ef739d-6701-4086-b911-007d1a3deb21",
"description": "Multiple files, several matches, inverted flag",
"property": "grep",
"input": {
"pattern": "a",
"flags": ["-v"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"iliad.txt:Achilles sing, O Goddess! Peleus' son;",
"iliad.txt:The noble Chief Achilles from the son",
"midsummer-night.txt:If I refuse to wed Demetrius."
]
},
{
"uuid": "77b2eb07-2921-4ea0-8971-7636b44f5d29",
"description": "Multiple files, one match, match entire lines flag",
"property": "grep",
"input": {
"pattern": "But I beseech your grace that I may know",
"flags": ["-x"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"midsummer-night.txt:But I beseech your grace that I may know"
]
},
{
"uuid": "e53a2842-55bb-4078-9bb5-04ac38929989",
"description": "Multiple files, one match, multiple flags",
"property": "grep",
"input": {
"pattern": "WITH LOSS OF EDEN, TILL ONE GREATER MAN",
"flags": ["-n", "-i", "-x"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"paradise-lost.txt:4:With loss of Eden, till one greater Man"
]
},
{
"uuid": "9c4f7f9a-a555-4e32-bb06-4b8f8869b2cb",
"description": "Multiple files, no matches, various flags",
"property": "grep",
"input": {
"pattern": "Frodo",
"flags": ["-n", "-l", "-x", "-i"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": []
},
{
"uuid": "ba5a540d-bffd-481b-bd0c-d9a30f225e01",
"description": "Multiple files, several matches, file flag takes precedence over line number flag",
"property": "grep",
"input": {
"pattern": "who",
"flags": ["-n", "-l"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": ["iliad.txt", "paradise-lost.txt"]
},
{
"uuid": "ff406330-2f0b-4b17-9ee4-4b71c31dd6d2",
"description": "Multiple files, several matches, inverted and match entire lines flags",
"property": "grep",
"input": {
"pattern": "Illustrious into Ades premature,",
"flags": ["-x", "-v"],
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
},
"expected": [
"iliad.txt:Achilles sing, O Goddess! Peleus' son;",
"iliad.txt:His wrath pernicious, who ten thousand woes",
"iliad.txt:Caused to Achaia's host, sent many a soul",
"iliad.txt:And Heroes gave (so stood the will of Jove)",
"iliad.txt:To dogs and to all ravening fowls a prey,",
"iliad.txt:When fierce dispute had separated once",
"iliad.txt:The noble Chief Achilles from the son",
"iliad.txt:Of Atreus, Agamemnon, King of men.",
"midsummer-night.txt:I do entreat your grace to pardon me.",
"midsummer-night.txt:I know not by what power I am made bold,",
"midsummer-night.txt:Nor how it may concern my modesty,",
"midsummer-night.txt:In such a presence here to plead my thoughts;",
"midsummer-night.txt:But I beseech your grace that I may know",
"midsummer-night.txt:The worst that may befall me in this case,",
"midsummer-night.txt:If I refuse to wed Demetrius.",
"paradise-lost.txt:Of Mans First Disobedience, and the Fruit",
"paradise-lost.txt:Of that Forbidden Tree, whose mortal tast",
"paradise-lost.txt:Brought Death into the World, and all our woe,",
"paradise-lost.txt:With loss of Eden, till one greater Man",
"paradise-lost.txt:Restore us, and regain the blissful Seat,",
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top",
"paradise-lost.txt:Of Oreb, or of Sinai, didst inspire",
"paradise-lost.txt:That Shepherd, who first taught the chosen Seed"
]
}
]
}
]
}