trackler 2.0.8.18 → 2.0.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/common/.gitignore +1 -0
- data/common/.travis.yml +5 -8
- data/common/README.md +18 -5
- data/common/exercises/grep/canonical-data.json +290 -269
- data/common/exercises/phone-number/canonical-data.json +2 -2
- data/common/exercises/pov/canonical-data.json +2 -5
- data/common/exercises/roman-numerals/canonical-data.json +112 -74
- data/common/exercises/tournament/canonical-data.json +86 -85
- data/common/exercises/two-bucket/canonical-data.json +55 -47
- data/common/package.json +16 -0
- data/common/yarn.lock +195 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/docs/LEARNING.md +1 -1
- data/tracks/c/exercises/space-age/src/example.c +15 -47
- data/tracks/c/exercises/space-age/src/example.h +12 -8
- data/tracks/c/exercises/space-age/test/test_space_age.c +8 -8
- data/tracks/ceylon/docs/TESTS.md +5 -2
- data/tracks/ceylon/exercises/TRACK_HINTS.md +5 -2
- data/tracks/csharp/.gitignore +0 -4
- data/tracks/csharp/.travis.yml +9 -20
- data/tracks/csharp/appveyor.yml +2 -4
- data/tracks/csharp/build.cake +95 -0
- data/tracks/csharp/build.ps1 +189 -0
- data/tracks/csharp/build.sh +99 -31
- data/tracks/csharp/circle.yml +3 -12
- data/tracks/delphi/config.json +8 -0
- data/tracks/delphi/exercises/minesweeper/MineSweeper.dpr +60 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperExample.pas +70 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +270 -0
- data/tracks/dlang/config.json +86 -31
- data/tracks/elixir/config.json +7 -0
- data/tracks/elixir/exercises/rotational-cipher/example.exs +35 -0
- data/tracks/elixir/exercises/rotational-cipher/rotational_cipher.exs +13 -0
- data/tracks/elixir/exercises/rotational-cipher/rotational_cipher_test.exs +80 -0
- data/tracks/go/exercises/raindrops/raindrops_test.go +4 -1
- data/tracks/go/exercises/react/react_test.go +6 -8
- data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +4 -1
- data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +5 -2
- data/tracks/haskell/exercises/allergies/src/Allergies.hs +2 -2
- data/tracks/haskell/exercises/atbash-cipher/src/Atbash.hs +2 -2
- data/tracks/haskell/exercises/bank-account/src/BankAccount.hs +3 -3
- data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +7 -7
- data/tracks/haskell/exercises/bowling/src/Bowling.hs +1 -1
- data/tracks/haskell/exercises/clock/src/Clock.hs +4 -4
- data/tracks/haskell/exercises/connect/src/Connect.hs +1 -1
- data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +1 -1
- data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +12 -12
- data/tracks/haskell/exercises/difference-of-squares/src/Squares.hs +3 -3
- data/tracks/haskell/exercises/etl/src/ETL.hs +1 -1
- data/tracks/haskell/exercises/forth/src/Forth.hs +2 -2
- data/tracks/haskell/exercises/go-counting/src/Counting.hs +2 -2
- data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -3
- data/tracks/haskell/exercises/largest-series-product/src/Series.hs +1 -1
- data/tracks/haskell/exercises/lens-person/src/Person.hs +4 -4
- data/tracks/julia/.travis.yml +3 -2
- data/tracks/ocaml/exercises/all-your-base/test.ml +2 -2
- data/tracks/ocaml/exercises/beer-song/test.ml +25 -24
- data/tracks/ocaml/exercises/phone-number/test.ml +22 -22
- data/tracks/ocaml/exercises/run-length-encoding/test.ml +5 -5
- data/tracks/ocaml/exercises/word-count/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/beer-song/template.ml +20 -1
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/word-count/bower.json +17 -0
- data/tracks/purescript/exercises/word-count/examples/src/WordCount.purs +31 -0
- data/tracks/purescript/exercises/word-count/src/WordCount.purs +3 -0
- data/tracks/purescript/exercises/word-count/test/Main.purs +89 -0
- data/tracks/python/exercises/accumulate/accumulate.py +2 -0
- data/tracks/python/exercises/acronym/acronym.py +2 -0
- data/tracks/python/exercises/allergies/allergies.py +3 -0
- data/tracks/python/exercises/allergies/example.py +1 -1
- data/tracks/python/exercises/anagram/anagram.py +2 -0
- data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +6 -0
- data/tracks/python/exercises/beer-song/beer_song.py +6 -0
- data/tracks/python/exercises/binary-search/binary_search.py +2 -0
- data/tracks/python/exercises/binary/binary.py +2 -0
- data/tracks/python/exercises/bob/bob.py +2 -8
- data/tracks/python/exercises/bracket-push/bracket_push.py +2 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer.py +11 -0
- data/tracks/python/exercises/clock/clock.py +3 -0
- data/tracks/python/exercises/clock/example.py +1 -1
- data/tracks/python/exercises/crypto-square/crypto_square.py +2 -0
- data/tracks/python/exercises/diamond/diamond.py +2 -0
- data/tracks/python/exercises/difference-of-squares/difference_of_squares.py +10 -0
- data/tracks/python/exercises/etl/etl.py +2 -0
- data/tracks/python/exercises/flatten-array/flatten_array.py +2 -0
- data/tracks/python/exercises/gigasecond/gigasecond.py +2 -0
- data/tracks/python/exercises/grade-school/grade_school.py +3 -0
- data/tracks/python/exercises/grains/grains.py +6 -0
- data/tracks/python/exercises/hamming/hamming.py +2 -0
- data/tracks/python/exercises/hello-world/hello_world.py +2 -7
- data/tracks/python/exercises/hexadecimal/hexadecimal.py +2 -0
- data/tracks/python/exercises/house/house.py +6 -0
- data/tracks/python/exercises/kindergarten-garden/kindergarten_garden.py +3 -0
- data/tracks/python/exercises/largest-series-product/largest_series_product.py +2 -0
- data/tracks/python/exercises/leap/leap.py +2 -0
- data/tracks/python/exercises/linked-list/linked_list.py +2 -8
- data/tracks/python/exercises/list-ops/list_ops.py +18 -22
- data/tracks/python/exercises/luhn/luhn.py +3 -0
- data/tracks/python/exercises/matrix/matrix.py +3 -0
- data/tracks/python/exercises/meetup/meetup.py +2 -0
- data/tracks/python/exercises/minesweeper/minesweeper.py +2 -0
- data/tracks/python/exercises/nth-prime/nth_prime.py +2 -0
- data/tracks/python/exercises/nucleotide-count/nucleotide_count.py +6 -0
- data/tracks/python/exercises/ocr-numbers/ocr_numbers.py +6 -0
- data/tracks/python/exercises/ocr-numbers/{ocr_test.py → ocr_numbers_test.py} +0 -0
- data/tracks/python/exercises/octal/octal.py +2 -0
- data/tracks/python/exercises/palindrome-products/palindrome_products.py +6 -0
- data/tracks/python/exercises/pangram/pangram.py +2 -0
- data/tracks/python/exercises/pascals-triangle/pascals_triangle.py +10 -0
- data/tracks/python/exercises/perfect-numbers/perfect_numbers.py +6 -0
- data/tracks/python/exercises/phone-number/phone_number.py +3 -0
- data/tracks/python/exercises/pig-latin/pig_latin.py +2 -0
- data/tracks/python/exercises/point-mutations/point_mutations.py +2 -0
- data/tracks/python/exercises/poker/poker.py +2 -0
- data/tracks/python/exercises/prime-factors/prime_factors.py +2 -0
- data/tracks/python/exercises/proverb/proverb.py +2 -0
- data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet.py +10 -0
- data/tracks/python/exercises/queen-attack/queen_attack.py +6 -0
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher.py +10 -0
- data/tracks/python/exercises/raindrops/raindrops.py +2 -0
- data/tracks/python/exercises/rectangles/example.py +1 -1
- data/tracks/python/exercises/rectangles/rectangles.py +2 -0
- data/tracks/python/exercises/rectangles/{rectangles_count_test.py → rectangles_test.py} +0 -0
- data/tracks/python/exercises/rna-transcription/rna_transcription.py +2 -0
- data/tracks/python/exercises/robot-name/robot_name.py +3 -0
- data/tracks/python/exercises/robot-simulator/robot_simulator.py +3 -0
- data/tracks/python/exercises/roman-numerals/roman_numerals.py +2 -0
- data/tracks/python/exercises/run-length-encoding/run_length_encoding.py +6 -0
- data/tracks/python/exercises/run-length-encoding/{run_length_test.py → run_length_encoding_test.py} +1 -1
- data/tracks/python/exercises/saddle-points/saddle_points.py +2 -0
- data/tracks/python/exercises/say/example.py +1 -1
- data/tracks/python/exercises/say/say.py +2 -0
- data/tracks/python/exercises/say/say_test.py +3 -0
- data/tracks/python/exercises/scrabble-score/scrabble_score.py +2 -0
- data/tracks/python/exercises/secret-handshake/secret_handshake.py +6 -0
- data/tracks/python/exercises/secret-handshake/{handshake_test.py → secret_handshake_test.py} +0 -0
- data/tracks/python/exercises/series/series.py +2 -0
- data/tracks/python/exercises/sieve/sieve.py +2 -0
- data/tracks/python/exercises/simple-cipher/example.py +1 -1
- data/tracks/python/exercises/simple-cipher/simple_cipher.py +8 -0
- data/tracks/python/exercises/space-age/space_age.py +3 -0
- data/tracks/python/exercises/strain/strain.py +6 -0
- data/tracks/python/exercises/sublist/sublist.py +2 -0
- data/tracks/python/exercises/sum-of-multiples/sum_of_multiples.py +2 -0
- data/tracks/python/exercises/triangle/triangle.py +7 -0
- data/tracks/python/exercises/trinary/trinary.py +2 -0
- data/tracks/python/exercises/twelve-days/twelve_days.py +10 -0
- data/tracks/python/exercises/word-count/word_count.py +2 -0
- data/tracks/python/exercises/wordy/wordy.py +2 -0
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +2 -0
- data/tracks/ruby/exercises/beer-song/.meta/.version +1 -0
- data/tracks/ruby/exercises/beer-song/beer_song_test.rb +62 -36
- data/tracks/ruby/exercises/beer-song/example.rb +1 -5
- data/tracks/ruby/exercises/beer-song/example.tt +22 -0
- data/tracks/ruby/lib/beer_song_cases.rb +43 -0
- data/tracks/swift/exercises/matrix/Tests/MatrixTests/MatrixTests.swift +1 -1
- metadata +94 -13
- data/common/bin/jsonlint +0 -27
- data/tracks/csharp/.paket/paket.bootstrapper.exe +0 -0
- data/tracks/csharp/Zipper.cs +0 -137
- data/tracks/csharp/build.cmd +0 -14
- data/tracks/csharp/build.fsx +0 -78
- data/tracks/csharp/paket.dependencies +0 -2
- data/tracks/csharp/paket.lock +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a18e7d1d01de5dac14394d4c662332c16d96702
|
|
4
|
+
data.tar.gz: ea97a61252024003df91aed43f471bed17ebd3eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd8893f9ee7a77e3cd946e475be1dd3d598a3749fd167037ac5279ccdeb01e88d3caf2bdedcee4cbceb161be47705ac79d4443be9238e2faf5e39599a16213d8
|
|
7
|
+
data.tar.gz: 13dd5a5e0552cb679fce68a2adbccb3fb588aa31ab627420cc81d4855f82fe56ed13138caa90c8965a08e6cca4f62577390117ed40cc58ca69024c0e0d063dda
|
data/common/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules
|
data/common/.travis.yml
CHANGED
data/common/README.md
CHANGED
|
@@ -113,13 +113,26 @@ There are also some convention about `expected` that you must follow:
|
|
|
113
113
|
|
|
114
114
|
## Automated Tests
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
`canonical-data.json` for each exercise is checked for compliancy against the [canonical-schema.json](canonical-schema.json).
|
|
117
|
+
In order to run these tests, you will need to have `node` and `npm` installed on your system.
|
|
118
|
+
Install them from [here](https://nodejs.org/en/). (`npm` comes bundled with most installations of `node`).
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
Install the required packages:
|
|
121
|
+
```shell
|
|
122
|
+
npm install
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Run for all exercises:
|
|
126
|
+
```shell
|
|
127
|
+
npm test
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Run for single exercise:
|
|
131
|
+
```shell
|
|
132
|
+
npm test-one exercises/<exercise>/canonical-data.json
|
|
133
|
+
```
|
|
134
|
+
Replace `<exercise>` by the name of exercise which you want to check.
|
|
121
135
|
|
|
122
|
-
bin/jsonlint
|
|
123
136
|
|
|
124
137
|
## License
|
|
125
138
|
|
|
@@ -1,276 +1,297 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
1
|
+
{
|
|
2
|
+
"exercise": "grep",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"comments": [
|
|
5
|
+
" JSON doesn't allow for multi-line strings, so all ",
|
|
6
|
+
" outputs are presented here as arrays of strings. ",
|
|
7
|
+
" It's up to the test generator to join the lines ",
|
|
8
|
+
" together with line breaks. ",
|
|
9
|
+
" ",
|
|
10
|
+
" The tests are divided into two groups: ",
|
|
11
|
+
" - Grepping a single file ",
|
|
12
|
+
" - Grepping multiple files at once ",
|
|
13
|
+
" ",
|
|
14
|
+
" The language track implementing this exercise ",
|
|
15
|
+
" should ensure that when the tests run, three files ",
|
|
16
|
+
" are created with the following contents. The file ",
|
|
17
|
+
" names and their contents are listed below: ",
|
|
18
|
+
" ",
|
|
19
|
+
" iliad.txt ",
|
|
20
|
+
" --------------------------------------------- ",
|
|
21
|
+
" |Achilles sing, O Goddess! Peleus' son; | ",
|
|
22
|
+
" |His wrath pernicious, who ten thousand woes| ",
|
|
23
|
+
" |Caused to Achaia's host, sent many a soul | ",
|
|
24
|
+
" |Illustrious into Ades premature, | ",
|
|
25
|
+
" |And Heroes gave (so stood the will of Jove)| ",
|
|
26
|
+
" |To dogs and to all ravening fowls a prey, | ",
|
|
27
|
+
" |When fierce dispute had separated once | ",
|
|
28
|
+
" |The noble Chief Achilles from the son | ",
|
|
29
|
+
" |Of Atreus, Agamemnon, King of men. | ",
|
|
30
|
+
" --------------------------------------------- ",
|
|
31
|
+
" ",
|
|
32
|
+
" midsummer-night.txt ",
|
|
33
|
+
" ----------------------------------------------- ",
|
|
34
|
+
" |I do entreat your grace to pardon me. | ",
|
|
35
|
+
" |I know not by what power I am made bold, | ",
|
|
36
|
+
" |Nor how it may concern my modesty, | ",
|
|
37
|
+
" |In such a presence here to plead my thoughts;| ",
|
|
38
|
+
" |But I beseech your grace that I may know | ",
|
|
39
|
+
" |The worst that may befall me in this case, | ",
|
|
40
|
+
" |If I refuse to wed Demetrius. | ",
|
|
41
|
+
" ----------------------------------------------- ",
|
|
42
|
+
" ",
|
|
43
|
+
" paradise-lost.txt ",
|
|
44
|
+
" ------------------------------------------------- ",
|
|
45
|
+
" |Of Mans First Disobedience, and the Fruit | ",
|
|
46
|
+
" |Of that Forbidden Tree, whose mortal tast | ",
|
|
47
|
+
" |Brought Death into the World, and all our woe, | ",
|
|
48
|
+
" |With loss of Eden, till one greater Man | ",
|
|
49
|
+
" |Restore us, and regain the blissful Seat, | ",
|
|
50
|
+
" |Sing Heav'nly Muse, that on the secret top | ",
|
|
51
|
+
" |Of Oreb, or of Sinai, didst inspire | ",
|
|
52
|
+
" |That Shepherd, who first taught the chosen Seed| ",
|
|
53
|
+
" ------------------------------------------------- "
|
|
54
|
+
],
|
|
55
|
+
"cases": [
|
|
56
|
+
{
|
|
57
|
+
"description": "Test grepping a single file",
|
|
58
|
+
"cases": [
|
|
17
59
|
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
60
|
+
"description": "One file, one match, no flags",
|
|
61
|
+
"property": "grep",
|
|
62
|
+
"pattern": "Agamemnon",
|
|
63
|
+
"flags": [],
|
|
64
|
+
"files": ["iliad.txt"],
|
|
65
|
+
"expected": [
|
|
66
|
+
"Of Atreus, Agamemnon, King of men."
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"description": "One file, one match, print line numbers flag",
|
|
71
|
+
"property": "grep",
|
|
72
|
+
"pattern": "Forbidden",
|
|
73
|
+
"flags": ["-n"],
|
|
74
|
+
"files": ["paradise-lost.txt"],
|
|
75
|
+
"expected": [
|
|
76
|
+
"2:Of that Forbidden Tree, whose mortal tast"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"description": "One file, one match, case-insensitive flag",
|
|
81
|
+
"property": "grep",
|
|
82
|
+
"pattern": "FORBIDDEN",
|
|
83
|
+
"flags": ["-i"],
|
|
84
|
+
"files": ["paradise-lost.txt"],
|
|
85
|
+
"expected": [
|
|
86
|
+
"Of that Forbidden Tree, whose mortal tast"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"description": "One file, one match, print file names flag",
|
|
91
|
+
"property": "grep",
|
|
92
|
+
"pattern": "Forbidden",
|
|
93
|
+
"flags": ["-l"],
|
|
94
|
+
"files": ["paradise-lost.txt"],
|
|
95
|
+
"expected": [
|
|
96
|
+
"paradise-lost.txt"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"description": "One file, one match, match entire lines flag",
|
|
101
|
+
"property": "grep",
|
|
102
|
+
"pattern": "With loss of Eden, till one greater Man",
|
|
103
|
+
"flags": ["-x"],
|
|
104
|
+
"files": ["paradise-lost.txt"],
|
|
105
|
+
"expected": [
|
|
106
|
+
"With loss of Eden, till one greater Man"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"description": "One file, one match, multiple flags",
|
|
111
|
+
"property": "grep",
|
|
112
|
+
"pattern": "OF ATREUS, Agamemnon, KIng of MEN.",
|
|
113
|
+
"flags": ["-n", "-i", "-x"],
|
|
114
|
+
"files": ["iliad.txt"],
|
|
115
|
+
"expected": [
|
|
116
|
+
"9:Of Atreus, Agamemnon, King of men."
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"description": "One file, several matches, no flags",
|
|
121
|
+
"property": "grep",
|
|
122
|
+
"pattern": "may",
|
|
123
|
+
"flags": [],
|
|
124
|
+
"files": ["midsummer-night.txt"],
|
|
125
|
+
"expected": [
|
|
126
|
+
"Nor how it may concern my modesty,",
|
|
127
|
+
"But I beseech your grace that I may know",
|
|
128
|
+
"The worst that may befall me in this case,"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"description": "One file, several matches, print line numbers flag",
|
|
133
|
+
"property": "grep",
|
|
134
|
+
"pattern": "may",
|
|
135
|
+
"flags": ["-n"],
|
|
136
|
+
"files": ["midsummer-night.txt"],
|
|
137
|
+
"expected": [
|
|
138
|
+
"3:Nor how it may concern my modesty,",
|
|
139
|
+
"5:But I beseech your grace that I may know",
|
|
140
|
+
"6:The worst that may befall me in this case,"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"description": "One file, several matches, match entire lines flag",
|
|
145
|
+
"property": "grep",
|
|
146
|
+
"pattern": "may",
|
|
147
|
+
"flags": ["-x"],
|
|
148
|
+
"files": ["midsummer-night.txt"],
|
|
149
|
+
"expected": []
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"description": "One file, several matches, case-insensitive flag",
|
|
153
|
+
"property": "grep",
|
|
154
|
+
"pattern": "ACHILLES",
|
|
155
|
+
"flags": ["-i"],
|
|
156
|
+
"files": ["iliad.txt"],
|
|
157
|
+
"expected": [
|
|
158
|
+
"Achilles sing, O Goddess! Peleus' son;",
|
|
159
|
+
"The noble Chief Achilles from the son"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
31
162
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
163
|
+
"description": "One file, several matches, inverted flag",
|
|
164
|
+
"property": "grep",
|
|
165
|
+
"pattern": "Of",
|
|
166
|
+
"flags": ["-v"],
|
|
167
|
+
"files": ["paradise-lost.txt"],
|
|
168
|
+
"expected": [
|
|
169
|
+
"Brought Death into the World, and all our woe,",
|
|
170
|
+
"With loss of Eden, till one greater Man",
|
|
171
|
+
"Restore us, and regain the blissful Seat,",
|
|
172
|
+
"Sing Heav'nly Muse, that on the secret top",
|
|
173
|
+
"That Shepherd, who first taught the chosen Seed"
|
|
174
|
+
]
|
|
42
175
|
},
|
|
43
176
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"Restore us, and regain the blissful Seat,",
|
|
51
|
-
"Sing Heav'nly Muse, that on the secret top",
|
|
52
|
-
"Of Oreb, or of Sinai, didst inspire",
|
|
53
|
-
"That Shepherd, who first taught the chosen Seed"
|
|
54
|
-
]
|
|
177
|
+
"description": "One file, no matches, various flags",
|
|
178
|
+
"property": "grep",
|
|
179
|
+
"pattern": "Gandalf",
|
|
180
|
+
"flags": ["-n", "-l", "-x", "-i"],
|
|
181
|
+
"files": ["iliad.txt"],
|
|
182
|
+
"expected": []
|
|
55
183
|
}
|
|
56
|
-
|
|
57
|
-
"single-file": {
|
|
58
|
-
"description": ["Test grepping a single file"],
|
|
59
|
-
"cases": [
|
|
60
|
-
{
|
|
61
|
-
"description": "One file, one match, no flags",
|
|
62
|
-
"pattern": "Agamemnon",
|
|
63
|
-
"flags": [],
|
|
64
|
-
"files": ["iliad.txt"],
|
|
65
|
-
"expected": [
|
|
66
|
-
"Of Atreus, Agamemnon, King of men."
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"description": "One file, one match, print line numbers flag",
|
|
71
|
-
"pattern": "Forbidden",
|
|
72
|
-
"flags": ["-n"],
|
|
73
|
-
"files": ["paradise-lost.txt"],
|
|
74
|
-
"expected": [
|
|
75
|
-
"2:Of that Forbidden Tree, whose mortal tast"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"description": "One file, one match, case-insensitive flag",
|
|
80
|
-
"pattern": "FORBIDDEN",
|
|
81
|
-
"flags": ["-i"],
|
|
82
|
-
"files": ["paradise-lost.txt"],
|
|
83
|
-
"expected": [
|
|
84
|
-
"Of that Forbidden Tree, whose mortal tast"
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"description": "One file, one match, print file names flag",
|
|
89
|
-
"pattern": "Forbidden",
|
|
90
|
-
"flags": ["-l"],
|
|
91
|
-
"files": ["paradise-lost.txt"],
|
|
92
|
-
"expected": [
|
|
93
|
-
"paradise-lost.txt"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"description": "One file, one match, match entire lines flag",
|
|
98
|
-
"pattern": "With loss of Eden, till one greater Man",
|
|
99
|
-
"flags": ["-x"],
|
|
100
|
-
"files": ["paradise-lost.txt"],
|
|
101
|
-
"expected": [
|
|
102
|
-
"With loss of Eden, till one greater Man"
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"description": "One file, one match, multiple flags",
|
|
107
|
-
"pattern": "OF ATREUS, Agamemnon, KIng of MEN.",
|
|
108
|
-
"flags": ["-n", "-i", "-x"],
|
|
109
|
-
"files": ["iliad.txt"],
|
|
110
|
-
"expected": [
|
|
111
|
-
"9:Of Atreus, Agamemnon, King of men."
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"description": "One file, several matches, no flags",
|
|
116
|
-
"pattern": "may",
|
|
117
|
-
"flags": [],
|
|
118
|
-
"files": ["midsummer-night.txt"],
|
|
119
|
-
"expected": [
|
|
120
|
-
"Nor how it may concern my modesty,",
|
|
121
|
-
"But I beseech your grace that I may know",
|
|
122
|
-
"The worst that may befall me in this case,"
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"description": "One file, several matches, print line numbers flag",
|
|
127
|
-
"pattern": "may",
|
|
128
|
-
"flags": ["-n"],
|
|
129
|
-
"files": ["midsummer-night.txt"],
|
|
130
|
-
"expected": [
|
|
131
|
-
"3:Nor how it may concern my modesty,",
|
|
132
|
-
"5:But I beseech your grace that I may know",
|
|
133
|
-
"6:The worst that may befall me in this case,"
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"description": "One file, several matches, match entire lines flag",
|
|
138
|
-
"pattern": "may",
|
|
139
|
-
"flags": ["-x"],
|
|
140
|
-
"files": ["midsummer-night.txt"],
|
|
141
|
-
"expected": []
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"description": "One file, several matches, case-insensitive flag",
|
|
145
|
-
"pattern": "ACHILLES",
|
|
146
|
-
"flags": ["-i"],
|
|
147
|
-
"files": ["iliad.txt"],
|
|
148
|
-
"expected": [
|
|
149
|
-
"Achilles sing, O Goddess! Peleus' son;",
|
|
150
|
-
"The noble Chief Achilles from the son"
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"description": "One file, several matches, inverted flag",
|
|
155
|
-
"pattern": "Of",
|
|
156
|
-
"flags": ["-v"],
|
|
157
|
-
"files": ["paradise-lost.txt"],
|
|
158
|
-
"expected": [
|
|
159
|
-
"Brought Death into the World, and all our woe,",
|
|
160
|
-
"With loss of Eden, till one greater Man",
|
|
161
|
-
"Restore us, and regain the blissful Seat,",
|
|
162
|
-
"Sing Heav'nly Muse, that on the secret top",
|
|
163
|
-
"That Shepherd, who first taught the chosen Seed"
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"description": "One file, no matches, various flags",
|
|
168
|
-
"pattern": "Gandalf",
|
|
169
|
-
"flags": ["-n", "-l", "-x", "-i"],
|
|
170
|
-
"files": ["iliad.txt"],
|
|
171
|
-
"expected": []
|
|
172
|
-
}
|
|
173
|
-
]
|
|
184
|
+
]
|
|
174
185
|
},
|
|
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
|
-
|
|
186
|
+
{
|
|
187
|
+
"description": "Test grepping multiples files at once",
|
|
188
|
+
"cases": [
|
|
189
|
+
{
|
|
190
|
+
"description": "Multiple files, one match, no flags",
|
|
191
|
+
"property": "grep",
|
|
192
|
+
"pattern": "Agamemnon",
|
|
193
|
+
"flags": [],
|
|
194
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
195
|
+
"expected": [
|
|
196
|
+
"iliad.txt:Of Atreus, Agamemnon, King of men."
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"description": "Multiple files, several matches, no flags",
|
|
201
|
+
"property": "grep",
|
|
202
|
+
"pattern": "may",
|
|
203
|
+
"flags": [],
|
|
204
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
205
|
+
"expected": [
|
|
206
|
+
"midsummer-night.txt:Nor how it may concern my modesty,",
|
|
207
|
+
"midsummer-night.txt:But I beseech your grace that I may know",
|
|
208
|
+
"midsummer-night.txt:The worst that may befall me in this case,"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"description": "Multiple files, several matches, print line numbers flag",
|
|
213
|
+
"property": "grep",
|
|
214
|
+
"pattern": "that",
|
|
215
|
+
"flags": ["-n"],
|
|
216
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
217
|
+
"expected": [
|
|
218
|
+
"midsummer-night.txt:5:But I beseech your grace that I may know",
|
|
219
|
+
"midsummer-night.txt:6:The worst that may befall me in this case,",
|
|
220
|
+
"paradise-lost.txt:2:Of that Forbidden Tree, whose mortal tast",
|
|
221
|
+
"paradise-lost.txt:6:Sing Heav'nly Muse, that on the secret top"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"description": "Multiple files, one match, print file names flag",
|
|
226
|
+
"property": "grep",
|
|
227
|
+
"pattern": "who",
|
|
228
|
+
"flags": ["-l"],
|
|
229
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
230
|
+
"expected": [
|
|
231
|
+
"iliad.txt",
|
|
232
|
+
"paradise-lost.txt"
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"description": "Multiple files, several matches, case-insensitive flag",
|
|
237
|
+
"property": "grep",
|
|
238
|
+
"pattern": "TO",
|
|
239
|
+
"flags": ["-i"],
|
|
240
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
241
|
+
"expected": [
|
|
242
|
+
"iliad.txt:Caused to Achaia's host, sent many a soul",
|
|
243
|
+
"iliad.txt:Illustrious into Ades premature,",
|
|
244
|
+
"iliad.txt:And Heroes gave (so stood the will of Jove)",
|
|
245
|
+
"iliad.txt:To dogs and to all ravening fowls a prey,",
|
|
246
|
+
"midsummer-night.txt:I do entreat your grace to pardon me.",
|
|
247
|
+
"midsummer-night.txt:In such a presence here to plead my thoughts;",
|
|
248
|
+
"midsummer-night.txt:If I refuse to wed Demetrius.",
|
|
249
|
+
"paradise-lost.txt:Brought Death into the World, and all our woe,",
|
|
250
|
+
"paradise-lost.txt:Restore us, and regain the blissful Seat,",
|
|
251
|
+
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"description": "Multiple files, several matches, inverted flag",
|
|
256
|
+
"property": "grep",
|
|
257
|
+
"pattern": "a",
|
|
258
|
+
"flags": ["-v"],
|
|
259
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
260
|
+
"expected": [
|
|
261
|
+
"iliad.txt:Achilles sing, O Goddess! Peleus' son;",
|
|
262
|
+
"iliad.txt:The noble Chief Achilles from the son",
|
|
263
|
+
"midsummer-night.txt:If I refuse to wed Demetrius."
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"description": "Multiple files, one match, match entire lines flag",
|
|
268
|
+
"property": "grep",
|
|
269
|
+
"pattern": "But I beseech your grace that I may know",
|
|
270
|
+
"flags": ["-x"],
|
|
271
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
272
|
+
"expected": [
|
|
273
|
+
"midsummer-night.txt:But I beseech your grace that I may know"
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"description": "Multiple files, one match, multiple flags",
|
|
278
|
+
"property": "grep",
|
|
279
|
+
"pattern": "WITH LOSS OF EDEN, TILL ONE GREATER MAN",
|
|
280
|
+
"flags": ["-n", "-i", "-x"],
|
|
281
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
282
|
+
"expected": [
|
|
283
|
+
"paradise-lost.txt:4:With loss of Eden, till one greater Man"
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"description": "Multiple files, no matches, various flags",
|
|
288
|
+
"property": "grep",
|
|
289
|
+
"pattern": "Frodo",
|
|
290
|
+
"flags": ["-n", "-l", "-x", "-i"],
|
|
291
|
+
"files": ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
292
|
+
"expected": []
|
|
293
|
+
}
|
|
294
|
+
]
|
|
275
295
|
}
|
|
276
|
-
|
|
296
|
+
]
|
|
297
|
+
}
|