Skip to content

Commit

Permalink
Improve based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andy1li committed Oct 28, 2024
1 parent 131a8f0 commit 8cf637b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 32 deletions.
14 changes: 7 additions & 7 deletions internal/stage_wildcard.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ func testWildcard(stageHarness *test_case_harness.TestCaseHarness) error {
Input: "cat",
ExpectedExitCode: 0,
},
{
Pattern: "c.t",
Input: "cot",
ExpectedExitCode: 0,
},
{
Pattern: "c.t",
Input: "car",
ExpectedExitCode: 1,
},
{
Pattern: "c.+t",
Input: "coat",
Pattern: "g.+gol",
Input: "goøö0Ogol",
ExpectedExitCode: 0,
},
{
Pattern: "g.+gol",
Input: "gol",
ExpectedExitCode: 1,
},
}

return RunTestCases(testCases, stageHarness)
Expand Down
9 changes: 4 additions & 5 deletions internal/test_helpers/fixtures/alternation/success
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
[stage-11] $ echo -n "cat" | ./your_grep.sh -E "c.t"
[your_program] cat
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "cot" | ./your_grep.sh -E "c.t"
[your_program] cot
[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] $ echo -n "goøö0Ogol" | ./your_grep.sh -E "g.+gol"
[your_program] goøö0Ogol
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "gol" | ./your_grep.sh -E "g.+gol"
[stage-11] ✓ Received exit code 1.
[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 @@ -95,14 +95,13 @@
[stage-11] $ echo -n "cat" | ./your_grep.sh -E "c.t"
[your_program] cat
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "cot" | ./your_grep.sh -E "c.t"
[your_program] cot
[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] $ echo -n "goøö0Ogol" | ./your_grep.sh -E "g.+gol"
[your_program] goøö0Ogol
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "gol" | ./your_grep.sh -E "g.+gol"
[stage-11] ✓ Received exit code 1.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
9 changes: 4 additions & 5 deletions internal/test_helpers/fixtures/backreferences_nested/success
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,13 @@
[stage-11] $ echo -n "cat" | ./your_grep.sh -E "c.t"
[your_program] cat
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "cot" | ./your_grep.sh -E "c.t"
[your_program] cot
[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] $ echo -n "goøö0Ogol" | ./your_grep.sh -E "g.+gol"
[your_program] goøö0Ogol
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "gol" | ./your_grep.sh -E "g.+gol"
[stage-11] ✓ Received exit code 1.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
9 changes: 4 additions & 5 deletions internal/test_helpers/fixtures/backreferences_single/success
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@
[stage-11] $ echo -n "cat" | ./your_grep.sh -E "c.t"
[your_program] cat
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "cot" | ./your_grep.sh -E "c.t"
[your_program] cot
[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] $ echo -n "goøö0Ogol" | ./your_grep.sh -E "g.+gol"
[your_program] goøö0Ogol
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "gol" | ./your_grep.sh -E "g.+gol"
[stage-11] ✓ Received exit code 1.
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ny8
Expand Down
9 changes: 4 additions & 5 deletions internal/test_helpers/fixtures/wildcard/success
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
[stage-11] $ echo -n "cat" | ./your_grep.sh -E "c.t"
[your_program] cat
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "cot" | ./your_grep.sh -E "c.t"
[your_program] cot
[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] $ echo -n "goøö0Ogol" | ./your_grep.sh -E "g.+gol"
[your_program] goøö0Ogol
[stage-11] ✓ Received exit code 0.
[stage-11] $ echo -n "gol" | ./your_grep.sh -E "g.+gol"
[stage-11] ✓ Received exit code 1.
[stage-11] Test passed.

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

0 comments on commit 8cf637b

Please sign in to comment.