From 6f110316433b17a337680fba166995c3add223ba Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:00:01 +0800 Subject: [PATCH 1/2] Add testcase to #fz7 --- internal/stage_one_or_more_quantifier.go | 5 +++++ internal/test_helpers/fixtures/alternation/success | 2 ++ .../test_helpers/fixtures/backreferences_multiple/success | 2 ++ internal/test_helpers/fixtures/backreferences_nested/success | 2 ++ internal/test_helpers/fixtures/backreferences_single/success | 2 ++ .../test_helpers/fixtures/one_or_more_quantifier/success | 2 ++ internal/test_helpers/fixtures/wildcard/success | 2 ++ .../test_helpers/fixtures/zero_or_one_quantifier/success | 2 ++ 8 files changed, 19 insertions(+) diff --git a/internal/stage_one_or_more_quantifier.go b/internal/stage_one_or_more_quantifier.go index d7dcb81..c40a391 100644 --- a/internal/stage_one_or_more_quantifier.go +++ b/internal/stage_one_or_more_quantifier.go @@ -21,6 +21,11 @@ func testOneOrMoreQuantifier(stageHarness *test_case_harness.TestCaseHarness) er Input: "act", ExpectedExitCode: 1, }, + { + Pattern: "ca+t", + Input: "ca", + ExpectedExitCode: 1, + }, } return RunTestCases(testCases, stageHarness) diff --git a/internal/test_helpers/fixtures/alternation/success b/internal/test_helpers/fixtures/alternation/success index fcfa07f..b674063 100644 --- a/internal/test_helpers/fixtures/alternation/success +++ b/internal/test_helpers/fixtures/alternation/success @@ -42,6 +42,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/backreferences_multiple/success b/internal/test_helpers/fixtures/backreferences_multiple/success index c3db816..5646be6 100644 --- a/internal/test_helpers/fixtures/backreferences_multiple/success +++ b/internal/test_helpers/fixtures/backreferences_multiple/success @@ -124,6 +124,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/backreferences_nested/success b/internal/test_helpers/fixtures/backreferences_nested/success index 89099f3..5561745 100644 --- a/internal/test_helpers/fixtures/backreferences_nested/success +++ b/internal/test_helpers/fixtures/backreferences_nested/success @@ -165,6 +165,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/backreferences_single/success b/internal/test_helpers/fixtures/backreferences_single/success index f911eeb..663d229 100644 --- a/internal/test_helpers/fixtures/backreferences_single/success +++ b/internal/test_helpers/fixtures/backreferences_single/success @@ -83,6 +83,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/one_or_more_quantifier/success b/internal/test_helpers/fixtures/one_or_more_quantifier/success index 5337aa3..bee1d38 100644 --- a/internal/test_helpers/fixtures/one_or_more_quantifier/success +++ b/internal/test_helpers/fixtures/one_or_more_quantifier/success @@ -7,6 +7,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/wildcard/success b/internal/test_helpers/fixtures/wildcard/success index 3efebdf..8f95556 100644 --- a/internal/test_helpers/fixtures/wildcard/success +++ b/internal/test_helpers/fixtures/wildcard/success @@ -31,6 +31,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 diff --git a/internal/test_helpers/fixtures/zero_or_one_quantifier/success b/internal/test_helpers/fixtures/zero_or_one_quantifier/success index 8994f30..1de64fd 100644 --- a/internal/test_helpers/fixtures/zero_or_one_quantifier/success +++ b/internal/test_helpers/fixtures/zero_or_one_quantifier/success @@ -20,6 +20,8 @@ [stage-9] ✓ Received exit code 0. [stage-9] $ echo -n "act" | ./your_grep.sh -E "ca+t" [stage-9] ✓ Received exit code 1. +[stage-9] $ echo -n "ca" | ./your_grep.sh -E "ca+t" +[stage-9] ✓ Received exit code 1. [stage-9] Test passed. [stage-8] Running tests for Stage #8: ao7 From 8e8f7bbf769509f041536da25538aa9e884445d2 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:35:11 +0800 Subject: [PATCH 2/2] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd97aeb..2fc95b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,9 +17,9 @@ jobs: go-version: 1.21.x - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' # The build from installing through the package manager doesn't have support for PCRE2 - name: Set up Ripgrep with PCRE2