diff --git a/internal/stage_q3.go b/internal/stage_q3.go index 41b26868..15105f48 100644 --- a/internal/stage_q3.go +++ b/internal/stage_q3.go @@ -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"), } diff --git a/internal/test_helpers/fixtures/quoting/pass b/internal/test_helpers/fixtures/quoting/pass index 3725d83a..fd6ba7be 100644 --- a/internal/test_helpers/fixtures/quoting/pass +++ b/internal/test_helpers/fixtures/quoting/pass @@ -42,12 +42,12 @@ Debug = true [stage-4] Running tests for Stage #4: yt5 [stage-4] Running ./your_shell.sh -[your-program] $ echo "before\ after" -[your-program] before\ after -[stage-4] ✓ Received expected response [your-program] $ echo script\ \ \ \ \ \ example [your-program] script example [stage-4] ✓ Received expected response +[your-program] $ echo \'\"example world\"\' +[your-program] '"example world"' +[stage-4] ✓ Received expected response [your-program] $ echo world\nhello [your-program] worldnhello [stage-4] ✓ Received expected response