From 7f05c7cd277dc052a87ff491d83ab565baf8ac37 Mon Sep 17 00:00:00 2001 From: libmartinito Date: Thu, 7 Mar 2024 20:09:15 +0800 Subject: [PATCH] refactor: update import paths for tester-utils packages in internal package --- internal/stage_alternation.go | 4 ++-- internal/stage_backreferences_multiple.go | 4 ++-- internal/stage_backreferences_nested.go | 4 ++-- internal/stage_backreferences_single.go | 4 ++-- internal/stage_combining_character_classes.go | 4 ++-- internal/stage_end_of_string_anchor.go | 4 ++-- internal/stage_init.go | 4 ++-- internal/stage_match_alphanumeric.go | 4 ++-- internal/stage_match_digit.go | 4 ++-- internal/stage_negative_character_groups.go | 4 ++-- internal/stage_one_or_more_quantifier.go | 4 ++-- internal/stage_positive_character_groups.go | 4 ++-- internal/stage_start_of_string_anchor.go | 4 ++-- internal/stage_wildcard.go | 4 ++-- internal/stage_zero_or_one_quantifier.go | 4 ++-- internal/test_case.go | 4 ++-- internal/tester_definition.go | 8 ++++---- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/internal/stage_alternation.go b/internal/stage_alternation.go index a93483d..ddbfbfc 100644 --- a/internal/stage_alternation.go +++ b/internal/stage_alternation.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testAlternation(stageHarness *tester_utils.StageHarness) error { +func testAlternation(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "a (cat|dog)", diff --git a/internal/stage_backreferences_multiple.go b/internal/stage_backreferences_multiple.go index 9bb3803..bae856a 100644 --- a/internal/stage_backreferences_multiple.go +++ b/internal/stage_backreferences_multiple.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testBackreferencesMultiple(stageHarness *tester_utils.StageHarness) error { +func testBackreferencesMultiple(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ // Base case { diff --git a/internal/stage_backreferences_nested.go b/internal/stage_backreferences_nested.go index 9f2356e..ba69305 100644 --- a/internal/stage_backreferences_nested.go +++ b/internal/stage_backreferences_nested.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testBackreferencesNested(stageHarness *tester_utils.StageHarness) error { +func testBackreferencesNested(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ // Base case { diff --git a/internal/stage_backreferences_single.go b/internal/stage_backreferences_single.go index 32e19c2..fcd9e29 100644 --- a/internal/stage_backreferences_single.go +++ b/internal/stage_backreferences_single.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testBackreferencesSingle(stageHarness *tester_utils.StageHarness) error { +func testBackreferencesSingle(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ // Base case { diff --git a/internal/stage_combining_character_classes.go b/internal/stage_combining_character_classes.go index 7a52ab8..7db7c7f 100644 --- a/internal/stage_combining_character_classes.go +++ b/internal/stage_combining_character_classes.go @@ -1,8 +1,8 @@ package internal -import tester_utils "github.com/codecrafters-io/tester-utils" +import "github.com/codecrafters-io/tester-utils/test_case_harness" -func testCombiningCharacterClasses(stageHarness *tester_utils.StageHarness) error { +func testCombiningCharacterClasses(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: `\d apple`, diff --git a/internal/stage_end_of_string_anchor.go b/internal/stage_end_of_string_anchor.go index c422609..47f9def 100644 --- a/internal/stage_end_of_string_anchor.go +++ b/internal/stage_end_of_string_anchor.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testEndOfStringAnchor(stageHarness *tester_utils.StageHarness) error { +func testEndOfStringAnchor(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "cat$", diff --git a/internal/stage_init.go b/internal/stage_init.go index 5475488..5f0461e 100644 --- a/internal/stage_init.go +++ b/internal/stage_init.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testInit(stageHarness *tester_utils.StageHarness) error { +func testInit(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "d", diff --git a/internal/stage_match_alphanumeric.go b/internal/stage_match_alphanumeric.go index 62db241..ea138f2 100644 --- a/internal/stage_match_alphanumeric.go +++ b/internal/stage_match_alphanumeric.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testMatchAlphanumeric(stageHarness *tester_utils.StageHarness) error { +func testMatchAlphanumeric(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: `\w`, diff --git a/internal/stage_match_digit.go b/internal/stage_match_digit.go index a531e74..1d825d8 100644 --- a/internal/stage_match_digit.go +++ b/internal/stage_match_digit.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testMatchDigit(stageHarness *tester_utils.StageHarness) error { +func testMatchDigit(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: `\d`, diff --git a/internal/stage_negative_character_groups.go b/internal/stage_negative_character_groups.go index 264f530..403da10 100644 --- a/internal/stage_negative_character_groups.go +++ b/internal/stage_negative_character_groups.go @@ -1,8 +1,8 @@ package internal -import tester_utils "github.com/codecrafters-io/tester-utils" +import "github.com/codecrafters-io/tester-utils/test_case_harness" -func testNegativeCharacterGroups(stageHarness *tester_utils.StageHarness) error { +func testNegativeCharacterGroups(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "[^xyz]", diff --git a/internal/stage_one_or_more_quantifier.go b/internal/stage_one_or_more_quantifier.go index 8c7e05c..d7dcb81 100644 --- a/internal/stage_one_or_more_quantifier.go +++ b/internal/stage_one_or_more_quantifier.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testOneOrMoreQuantifier(stageHarness *tester_utils.StageHarness) error { +func testOneOrMoreQuantifier(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "ca+t", diff --git a/internal/stage_positive_character_groups.go b/internal/stage_positive_character_groups.go index efdb164..3d87273 100644 --- a/internal/stage_positive_character_groups.go +++ b/internal/stage_positive_character_groups.go @@ -1,8 +1,8 @@ package internal -import tester_utils "github.com/codecrafters-io/tester-utils" +import "github.com/codecrafters-io/tester-utils/test_case_harness" -func testPositiveCharacterGroups(stageHarness *tester_utils.StageHarness) error { +func testPositiveCharacterGroups(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "[abcd]", diff --git a/internal/stage_start_of_string_anchor.go b/internal/stage_start_of_string_anchor.go index db814f1..ec9c43e 100644 --- a/internal/stage_start_of_string_anchor.go +++ b/internal/stage_start_of_string_anchor.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testStartOfStringAnchor(stageHarness *tester_utils.StageHarness) error { +func testStartOfStringAnchor(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "^log", diff --git a/internal/stage_wildcard.go b/internal/stage_wildcard.go index 999bcf0..d97ae46 100644 --- a/internal/stage_wildcard.go +++ b/internal/stage_wildcard.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testWildcard(stageHarness *tester_utils.StageHarness) error { +func testWildcard(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "c.t", diff --git a/internal/stage_zero_or_one_quantifier.go b/internal/stage_zero_or_one_quantifier.go index 77e1536..448f3a2 100644 --- a/internal/stage_zero_or_one_quantifier.go +++ b/internal/stage_zero_or_one_quantifier.go @@ -1,10 +1,10 @@ package internal import ( - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) -func testZeroOrOneQuantifier(stageHarness *tester_utils.StageHarness) error { +func testZeroOrOneQuantifier(stageHarness *test_case_harness.TestCaseHarness) error { testCases := []TestCase{ { Pattern: "ca?t", diff --git a/internal/test_case.go b/internal/test_case.go index 4e82f0a..910d4a6 100644 --- a/internal/test_case.go +++ b/internal/test_case.go @@ -2,7 +2,7 @@ package internal import ( "fmt" - tester_utils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/test_case_harness" ) type TestCase struct { @@ -11,7 +11,7 @@ type TestCase struct { ExpectedExitCode int } -func RunTestCases(testCases []TestCase, stageHarness *tester_utils.StageHarness) error { +func RunTestCases(testCases []TestCase, stageHarness *test_case_harness.TestCaseHarness) error { logger := stageHarness.Logger executable := stageHarness.Executable diff --git a/internal/tester_definition.go b/internal/tester_definition.go index 14cafd4..8490f83 100644 --- a/internal/tester_definition.go +++ b/internal/tester_definition.go @@ -1,14 +1,14 @@ package internal import ( - testerutils "github.com/codecrafters-io/tester-utils" + "github.com/codecrafters-io/tester-utils/tester_definition" "time" ) -var testerDefinition = testerutils.TesterDefinition{ - AntiCheatTestCases: []testerutils.TestCase{}, +var testerDefinition = tester_definition.TesterDefinition{ + AntiCheatTestCases: []tester_definition.TestCase{}, ExecutableFileName: "your_grep.sh", - TestCases: []testerutils.TestCase{ + TestCases: []tester_definition.TestCase{ { Slug: "init", TestFunc: testInit,