Skip to content

Commit

Permalink
feat: add more tests for backslashes outside quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Dec 27, 2024
1 parent 97b8bda commit d052433
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/stage_q3.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ func testQ3(stageHarness *test_case_harness.TestCaseHarness) error {

L := random.RandomElementsFromArray(LARGE_WORDS, 5)
inputs := []string{
`echo "before\ after"`,
fmt.Sprintf(`echo %s\ \ \ \ \ \ %s`, L[0], L[1]),
fmt.Sprintf(`echo \'\"%s %s\"\'`, L[1], L[2]),
fmt.Sprintf(`echo %s\n%s`, L[2], L[3]),
fmt.Sprintf(`cat "%s" "%s" "%s"`, filePaths[0], filePaths[1], filePaths[2]),
}
expectedOutputs := []string{
`before\ after`,
fmt.Sprintf("%s %s", L[0], L[1]),
fmt.Sprintf(`'"%s %s"'`, L[1], L[2]),
fmt.Sprintf("%sn%s", L[2], L[3]),
fileContents[0] + fileContents[1] + strings.TrimRight(fileContents[2], "\n"),
}
Expand Down

0 comments on commit d052433

Please sign in to comment.