Skip to content

Commit 83fb413

Browse files
committed
Update test cases to replace 'Buffalo' pattern with a new regex for counting animals
1 parent 02e4880 commit 83fb413

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

internal/stage_alternation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ func testAlternation(stageHarness *test_case_harness.TestCaseHarness) error {
1717
ExpectedExitCode: 1,
1818
},
1919
{
20-
Pattern: "^((Buffalo|buffalo)[ ]?)+$",
21-
Input: "Buffalo buffalo buffalo Buffalo buffalo",
20+
Pattern: "^I see (\\d (cat|dog|cow)s?(, | and )?)+$",
21+
Input: "I see 1 cat, 2 dogs and 3 cows",
2222
ExpectedExitCode: 0,
2323
},
2424
{

internal/test_helpers/fixtures/alternation/success

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[stage-12] ✓ Received exit code 0.
55
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
66
[stage-12] ✓ Received exit code 1.
7-
[stage-12] $ echo -n "Buffalo buffalo buffalo Buffalo buffalo" | ./your_grep.sh -E "^((Buffalo|buffalo)[ ]?)+$"
8-
[your_program] Buffalo buffalo buffalo Buffalo buffalo
7+
[stage-12] $ echo -n "I see 1 cat, 2 dogs and 3 cows" | ./your_grep.sh -E "I see (\d (cat|dog|cow)s?(, | and )?)+"
8+
[your_program] I see 1 cat, 2 dogs and 3 cows
99
[stage-12] ✓ Received exit code 0.
1010
[stage-12] $ echo -n "Will, will Will will Will Will's will" | ./your_grep.sh -E "^([Ww]ill(, | |'s )?)+$"
1111
[your_program] Will, will Will will Will Will's will

internal/test_helpers/fixtures/backreferences_multiple/success

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
[stage-12] ✓ Received exit code 0.
8787
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
8888
[stage-12] ✓ Received exit code 1.
89-
[stage-12] $ echo -n "Buffalo buffalo buffalo Buffalo buffalo" | ./your_grep.sh -E "^((Buffalo|buffalo)[ ]?)+$"
90-
[your_program] Buffalo buffalo buffalo Buffalo buffalo
89+
[stage-12] $ echo -n "I see 1 cat, 2 dogs and 3 cows" | ./your_grep.sh -E "I see (\d (cat|dog|cow)s?(, | and )?)+"
90+
[your_program] I see 1 cat, 2 dogs and 3 cows
9191
[stage-12] ✓ Received exit code 0.
9292
[stage-12] $ echo -n "Will, will Will will Will Will's will" | ./your_grep.sh -E "^([Ww]ill(, | |'s )?)+$"
9393
[your_program] Will, will Will will Will Will's will

internal/test_helpers/fixtures/backreferences_nested/success

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
[stage-12] ✓ Received exit code 0.
128128
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
129129
[stage-12] ✓ Received exit code 1.
130-
[stage-12] $ echo -n "Buffalo buffalo buffalo Buffalo buffalo" | ./your_grep.sh -E "^((Buffalo|buffalo)[ ]?)+$"
131-
[your_program] Buffalo buffalo buffalo Buffalo buffalo
130+
[stage-12] $ echo -n "I see 1 cat, 2 dogs and 3 cows" | ./your_grep.sh -E "I see (\d (cat|dog|cow)s?(, | and )?)+"
131+
[your_program] I see 1 cat, 2 dogs and 3 cows
132132
[stage-12] ✓ Received exit code 0.
133133
[stage-12] $ echo -n "Will, will Will will Will Will's will" | ./your_grep.sh -E "^([Ww]ill(, | |'s )?)+$"
134134
[your_program] Will, will Will will Will Will's will

internal/test_helpers/fixtures/backreferences_single/success

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
[stage-12] ✓ Received exit code 0.
4646
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
4747
[stage-12] ✓ Received exit code 1.
48-
[stage-12] $ echo -n "Buffalo buffalo buffalo Buffalo buffalo" | ./your_grep.sh -E "^((Buffalo|buffalo)[ ]?)+$"
49-
[your_program] Buffalo buffalo buffalo Buffalo buffalo
48+
[stage-12] $ echo -n "I see 1 cat, 2 dogs and 3 cows" | ./your_grep.sh -E "I see (\d (cat|dog|cow)s?(, | and )?)+"
49+
[your_program] I see 1 cat, 2 dogs and 3 cows
5050
[stage-12] ✓ Received exit code 0.
5151
[stage-12] $ echo -n "Will, will Will will Will Will's will" | ./your_grep.sh -E "^([Ww]ill(, | |'s )?)+$"
5252
[your_program] Will, will Will will Will Will's will

0 commit comments

Comments
 (0)