Skip to content

Commit

Permalink
chore: remove seperator from testnames
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Jan 14, 2025
1 parent 3063143 commit 5727350
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/corpus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
)

var (
TESTCASE_SEPERATOR = regexp.MustCompile("\n(=+)\n")
INPUT_OUTPUT_SEPERATOR = regexp.MustCompile("\n(---)\n")
TESTS_DIR = "./corpus"
TESTCASE_SEPERATOR = regexp.MustCompile("(?m)^(=+)$")
INPUT_OUTPUT_SEPERATOR = regexp.MustCompile("\n(---)\n")
TRIM_TESTCASE_SEPERATOR = regexp.MustCompile("^(=+)\n")
TESTS_DIR = "./corpus"
)

func TestCorpus(t *testing.T) {
Expand Down Expand Up @@ -69,7 +70,15 @@ func NewTestCase(file, name, input, sExpression string) TestCase {

func getTestCasesForFile(filename string, content string) []TestCase {
testCases := []TestCase{}
parts := TESTCASE_SEPERATOR.Split(content, -1)
partsWithEmptyParts := TESTCASE_SEPERATOR.Split(content, -1)
parts := []string{}

// remove empty parts
for i := 0; i < len(partsWithEmptyParts); i++ {
if partsWithEmptyParts[i] != "" {
parts = append(parts, partsWithEmptyParts[i])
}
}

for i := 0; i < len(parts); i++ {
if i%2 == 0 && len(parts) > i+1 {
Expand Down

0 comments on commit 5727350

Please sign in to comment.