Skip to content

Commit b0ef8ff

Browse files
authored
Merge pull request #165 from codecrafters-io/stage-1
Stage 1 - Fixtures
2 parents f8d7255 + da16954 commit b0ef8ff

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

internal/stages_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ func TestStages(t *testing.T) {
4848
StdoutFixturePath: "./test_helpers/fixtures/run_program_newline_in_args",
4949
NormalizeOutputFunc: normalizeTesterOutput,
5050
},
51+
"stage_1_only_prompt_pass": {
52+
StageSlugs: []string{"oo8"},
53+
CodePath: "./test_helpers/scenarios/stage_1_only_prompt",
54+
ExpectedExitCode: 0,
55+
StdoutFixturePath: "./test_helpers/fixtures/stage_1_only_prompt",
56+
NormalizeOutputFunc: normalizeTesterOutput,
57+
},
5158
"base_pass_bash": {
5259
UntilStageSlug: "ip1",
5360
CodePath: "./test_helpers/bash",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Debug = true
2+
3+
[tester::#OO8] Running tests for Stage #OO8 (oo8)
4+
[tester::#OO8] Running ./your_program.sh
5+
[your-program] $
6+
[tester::#OO8] ✓ Received prompt
7+
[tester::#OO8] Test passed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
debug: true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
3+
def main():
4+
sys.stdout.write("$ ")
5+
sys.stdout.flush()
6+
7+
8+
if __name__ == "__main__":
9+
main()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec python3 $(dirname "$0")/main.py "$@"

0 commit comments

Comments
 (0)