Skip to content

Commit

Permalink
Merge pull request #32 from codecrafters-io/add-testcase-to-zm7
Browse files Browse the repository at this point in the history
Add a test case to #zm7
  • Loading branch information
andy1li authored Nov 12, 2024
2 parents 33ca68e + 10911b7 commit e77f1af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/stage_alternation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func testAlternation(stageHarness *test_case_harness.TestCaseHarness) error {
ExpectedExitCode: 0,
},
{
Pattern: "a (cat|dog)",
Input: "a dog",
Pattern: "a (cat|dog) and (cat|dog)s",
Input: "a dog and cats",
ExpectedExitCode: 0,
},
{
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/alternation/success
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[stage-12] $ echo -n "a cat" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a cat
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a dog" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a dog
[stage-12] $ echo -n "a dog and cats" | ./your_grep.sh -E "a (cat|dog) and (cat|dog)s"
[your_program] a dog and cats
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
[stage-12] ✓ Received exit code 1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
[stage-12] $ echo -n "a cat" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a cat
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a dog" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a dog
[stage-12] $ echo -n "a dog and cats" | ./your_grep.sh -E "a (cat|dog) and (cat|dog)s"
[your_program] a dog and cats
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
[stage-12] ✓ Received exit code 1.
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/backreferences_nested/success
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
[stage-12] $ echo -n "a cat" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a cat
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a dog" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a dog
[stage-12] $ echo -n "a dog and cats" | ./your_grep.sh -E "a (cat|dog) and (cat|dog)s"
[your_program] a dog and cats
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
[stage-12] ✓ Received exit code 1.
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/backreferences_single/success
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
[stage-12] $ echo -n "a cat" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a cat
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a dog" | ./your_grep.sh -E "a (cat|dog)"
[your_program] a dog
[stage-12] $ echo -n "a dog and cats" | ./your_grep.sh -E "a (cat|dog) and (cat|dog)s"
[your_program] a dog and cats
[stage-12] ✓ Received exit code 0.
[stage-12] $ echo -n "a cow" | ./your_grep.sh -E "a (cat|dog)"
[stage-12] ✓ Received exit code 1.
Expand Down

0 comments on commit e77f1af

Please sign in to comment.