Skip to content

Commit f8d7255

Browse files
authored
Merge pull request #164 from codecrafters-io/andy/tweak
Move writeFiles #tg6 Double quotes
2 parents fef0174 + e024361 commit f8d7255

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

internal/stage_q2.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ func testQ2(stageHarness *test_case_harness.TestCaseHarness) error {
5959
fmt.Sprintf(`%s %s's %s%s`, L[3], L[4], L[1], L[2]),
6060
fileContents[0] + fileContents[1] + strings.TrimRight(fileContents[2], "\n"),
6161
}
62-
if err := writeFiles(filePaths, fileContents, logger); err != nil {
63-
return err
64-
}
6562

6663
testCaseContents := newTestCaseContents(inputs, expectedOutputs)
6764

@@ -77,6 +74,10 @@ func testQ2(stageHarness *test_case_harness.TestCaseHarness) error {
7774
}
7875
}
7976

77+
if err := writeFiles(filePaths, fileContents, logger); err != nil {
78+
return err
79+
}
80+
8081
testCase := test_cases.CommandResponseTestCase{
8182
Command: testCaseContents[3].Input,
8283
ExpectedOutput: testCaseContents[3].ExpectedOutput,

internal/test_helpers/fixtures/ash/quoting/pass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ Debug = true
2424
[tester::#TG6] Running tests for Stage #TG6 (tg6)
2525
[tester::#TG6] [setup] export PATH=/tmp/raspberry/banana/blueberry:$PATH
2626
[tester::#TG6] Running ./your_shell.sh
27-
[tester::#TG6] [setup] echo -n "orange blueberry." > "/tmp/bar/f 58"
28-
[tester::#TG6] [setup] echo -n "grape pineapple." > "/tmp/bar/f 73"
29-
[tester::#TG6] [setup] echo "raspberry mango." > "/tmp/bar/f's38"
3027
[your-program] $ echo "shell world"
3128
[your-program] shell world
3229
[tester::#TG6] ✓ Received expected response
@@ -36,6 +33,9 @@ Debug = true
3633
[your-program] $ echo "script" "hello's" world""example
3734
[your-program] script hello's worldexample
3835
[tester::#TG6] ✓ Received expected response
36+
[tester::#TG6] [setup] echo -n "orange blueberry." > "/tmp/bar/f 58"
37+
[tester::#TG6] [setup] echo -n "grape pineapple." > "/tmp/bar/f 73"
38+
[tester::#TG6] [setup] echo "raspberry mango." > "/tmp/bar/f's38"
3939
[your-program] $ cat "/tmp/bar/f 58" "/tmp/bar/f 73" "/tmp/bar/f's38"
4040
[your-program] orange blueberry.grape pineapple.raspberry mango.
4141
[tester::#TG6] ✓ Received expected response

internal/test_helpers/fixtures/bash/quoting/pass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ Debug = true
2424
[tester::#TG6] Running tests for Stage #TG6 (tg6)
2525
[tester::#TG6] [setup] export PATH=/tmp/raspberry/banana/blueberry:$PATH
2626
[tester::#TG6] Running ./your_shell.sh
27-
[tester::#TG6] [setup] echo -n "orange blueberry." > "/tmp/bar/f 58"
28-
[tester::#TG6] [setup] echo -n "grape pineapple." > "/tmp/bar/f 73"
29-
[tester::#TG6] [setup] echo "raspberry mango." > "/tmp/bar/f's38"
3027
[your-program] $ echo "shell world"
3128
[your-program] shell world
3229
[tester::#TG6] ✓ Received expected response
@@ -36,6 +33,9 @@ Debug = true
3633
[your-program] $ echo "script" "hello's" world""example
3734
[your-program] script hello's worldexample
3835
[tester::#TG6] ✓ Received expected response
36+
[tester::#TG6] [setup] echo -n "orange blueberry." > "/tmp/bar/f 58"
37+
[tester::#TG6] [setup] echo -n "grape pineapple." > "/tmp/bar/f 73"
38+
[tester::#TG6] [setup] echo "raspberry mango." > "/tmp/bar/f's38"
3939
[your-program] $ cat "/tmp/bar/f 58" "/tmp/bar/f 73" "/tmp/bar/f's38"
4040
[your-program] orange blueberry.grape pineapple.raspberry mango.
4141
[tester::#TG6] ✓ Received expected response

0 commit comments

Comments
 (0)