Skip to content

Commit

Permalink
Add test case .+ for zb3
Browse files Browse the repository at this point in the history
  • Loading branch information
andy1li committed Oct 28, 2024
1 parent d9e7727 commit 131a8f0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/stage_wildcard.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ func testWildcard(stageHarness *test_case_harness.TestCaseHarness) error {
Input: "car",
ExpectedExitCode: 1,
},
{
Pattern: "c.+t",
Input: "coat",
ExpectedExitCode: 0,
},
}

return RunTestCases(testCases, stageHarness)
Expand Down
3 changes: 3 additions & 0 deletions internal/test_helpers/fixtures/alternation/success
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "car" | ./your_grep.sh -E "c.t"
[stage-11] ✓ Received exit code 1.
[stage-11] $ echo -n "coat" | ./your_grep.sh -E "c.+t"
[your_program] coat
[stage-11] ✓ Received exit code 0.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "car" | ./your_grep.sh -E "c.t"
[stage-11] ✓ Received exit code 1.
[stage-11] $ echo -n "coat" | ./your_grep.sh -E "c.+t"
[your_program] coat
[stage-11] ✓ Received exit code 0.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
3 changes: 3 additions & 0 deletions internal/test_helpers/fixtures/backreferences_nested/success
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "car" | ./your_grep.sh -E "c.t"
[stage-11] ✓ Received exit code 1.
[stage-11] $ echo -n "coat" | ./your_grep.sh -E "c.+t"
[your_program] coat
[stage-11] ✓ Received exit code 0.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
3 changes: 3 additions & 0 deletions internal/test_helpers/fixtures/backreferences_single/success
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "car" | ./your_grep.sh -E "c.t"
[stage-11] ✓ Received exit code 1.
[stage-11] $ echo -n "coat" | ./your_grep.sh -E "c.+t"
[your_program] coat
[stage-11] ✓ Received exit code 0.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
3 changes: 3 additions & 0 deletions internal/test_helpers/fixtures/wildcard/success
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "car" | ./your_grep.sh -E "c.t"
[stage-11] ✓ Received exit code 1.
[stage-11] $ echo -n "coat" | ./your_grep.sh -E "c.+t"
[your_program] coat
[stage-11] ✓ Received exit code 0.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down

0 comments on commit 131a8f0

Please sign in to comment.