Skip to content

Commit

Permalink
tests: add fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed May 23, 2024
1 parent d8576fd commit 7da7c06
Show file tree
Hide file tree
Showing 2 changed files with 308 additions and 0 deletions.
119 changes: 119 additions & 0 deletions internal/test_helpers/fixtures/base/pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Debug = true

[stage-8] Running tests for Stage #8: ip1
[stage-8] Running ./spawn_shell.sh
/workspaces/shell-tester/internal <nil>
[your-program] $
[stage-8] > ./my_exe
[your-program] 384215599859
[stage-8] ✓ Received expected response
[your-program] $
[stage-8] Test passed.

[stage-7] Running tests for Stage #7: mg5
[stage-7] Running ./spawn_shell.sh
[your-program] $
[stage-7] > type cat
[your-program] cat is /usr/bin/cat
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type cp
[your-program] cp is /usr/bin/cp
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type mkdir
[your-program] mkdir is /usr/bin/mkdir
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type my_exe
[your-program] my_exe is /workspaces/shell-tester/internal/my_exe
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type nonexistent
[your-program] bash: type: nonexistent: not found
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] Test passed.

[stage-6] Running tests for Stage #6: ez5
[stage-6] Running ./spawn_shell.sh
[your-program] $
[stage-6] > type echo
[your-program] echo is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type exit
[your-program] exit is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type type
[your-program] type is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type nonexistent
[your-program] bash: type: nonexistent: not found
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type nonexistentcommand
[your-program] bash: type: nonexistentcommand: not found
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] Test passed.

[stage-5] Running tests for Stage #5: iz3
[stage-5] Running ./spawn_shell.sh
[your-program] $
[stage-5] > echo pineapple, grape, raspberry
[your-program] pineapple, grape, raspberry
[stage-5] ✓ Received expected response
[your-program] $
[stage-5] > echo grape
[your-program] grape
[stage-5] ✓ Received expected response
[your-program] $
[stage-5] Test passed.

[stage-4] Running tests for Stage #4: pn5
[stage-4] Running ./spawn_shell.sh
[your-program] $
[stage-4] > invalid_command_1
[your-program] bash: invalid_command_1: command not found
[stage-4] ✓ Received command not found message
[your-program] $
[stage-4] > exit 0
[your-program] exit
[your-program] 
[stage-4] ✓ Program exited successfully
[stage-4] ✓ No output after exit command
[stage-4] Test passed.

[stage-3] Running tests for Stage #3: ff0
[stage-3] Running ./spawn_shell.sh
[your-program] $
[stage-3] > invalid_command_1
[your-program] bash: invalid_command_1: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] > invalid_command_2
[your-program] bash: invalid_command_2: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] > invalid_command_3
[your-program] bash: invalid_command_3: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] Test passed.

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./spawn_shell.sh
[your-program] $
[stage-2] > nonexistent
[your-program] bash: nonexistent: command not found
[stage-2] ✓ Received command not found message
[stage-2] Test passed.

[stage-1] Running tests for Stage #1: oo8
[stage-1] Running ./spawn_shell.sh
[your-program] $
[stage-1] ✓ Received prompt
[stage-1] Test passed.
189 changes: 189 additions & 0 deletions internal/test_helpers/fixtures/navigation/pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
Debug = true

[stage-12] Running tests for Stage #12: gp4
[stage-12] Running ./spawn_shell.sh
[your-program] $
[stage-12] ✓ Received prompt
[stage-12] > cd /usr/local/bin
[your-program] $
[stage-12] > pwd
[your-program] /usr/local/bin
[stage-12] ✓ Received current working directory response
[your-program] $
[stage-12] ✓ Received prompt
[stage-12] > cd ~
[your-program] $
[stage-12] > pwd
[your-program] /home/codespace
[stage-12] ✓ Received current working directory response
[your-program] $
[stage-12] Test passed.

[stage-11] Running tests for Stage #11: gq9
[stage-11] Running ./spawn_shell.sh
[your-program] $
[stage-11] ✓ Received prompt
[stage-11] > cd /usr/
[your-program] $
[stage-11] > pwd
[your-program] /usr
[stage-11] ✓ Received current working directory response
[your-program] $
[stage-11] ✓ Received prompt
[stage-11] > cd ./local/bin
[your-program] $
[stage-11] > pwd
[your-program] /usr/local/bin
[stage-11] ✓ Received current working directory response
[your-program] $
[stage-11] ✓ Received prompt
[stage-11] > cd ../../
[your-program] $
[stage-11] > pwd
[your-program] /usr
[stage-11] ✓ Received current working directory response
[your-program] $
[stage-11] Test passed.

[stage-10] Running tests for Stage #10: ra6
[stage-10] Running ./spawn_shell.sh
[your-program] $
[stage-10] ✓ Received prompt
[stage-10] > cd /usr/local/bin
[your-program] $
[stage-10] > pwd
[your-program] /usr/local/bin
[stage-10] ✓ Received current working directory response
[your-program] $
[stage-10] > cd /non-existing-directory
[your-program] bash: cd: /non-existing-directory: No such file or directory
[stage-10] ✓ Received error message
[your-program] $
[stage-10] Test passed.

[stage-9] Running tests for Stage #9: ei0
[stage-9] Running ./spawn_shell.sh
[your-program] $
[stage-9] > pwd
[your-program] /workspaces/shell-tester/internal
[stage-9] ✓ Received current working directory response
[your-program] $
[stage-9] Test passed.

[stage-8] Running tests for Stage #8: ip1
[stage-8] Running ./spawn_shell.sh
/workspaces/shell-tester/internal <nil>
[your-program] $
[stage-8] > ./my_exe
[your-program] 384215599859
[stage-8] ✓ Received expected response
[your-program] $
[stage-8] Test passed.

[stage-7] Running tests for Stage #7: mg5
[stage-7] Running ./spawn_shell.sh
[your-program] $
[stage-7] > type cat
[your-program] cat is /usr/bin/cat
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type cp
[your-program] cp is /usr/bin/cp
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type mkdir
[your-program] mkdir is /usr/bin/mkdir
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type my_exe
[your-program] my_exe is /workspaces/shell-tester/internal/my_exe
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] > type nonexistent
[your-program] bash: type: nonexistent: not found
[stage-7] ✓ Received expected response
[your-program] $
[stage-7] Test passed.

[stage-6] Running tests for Stage #6: ez5
[stage-6] Running ./spawn_shell.sh
[your-program] $
[stage-6] > type echo
[your-program] echo is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type exit
[your-program] exit is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type type
[your-program] type is a shell builtin
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type nonexistent
[your-program] bash: type: nonexistent: not found
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] > type nonexistentcommand
[your-program] bash: type: nonexistentcommand: not found
[stage-6] ✓ Received expected response
[your-program] $
[stage-6] Test passed.

[stage-5] Running tests for Stage #5: iz3
[stage-5] Running ./spawn_shell.sh
[your-program] $
[stage-5] > echo pineapple, grape, raspberry
[your-program] pineapple, grape, raspberry
[stage-5] ✓ Received expected response
[your-program] $
[stage-5] > echo grape
[your-program] grape
[stage-5] ✓ Received expected response
[your-program] $
[stage-5] Test passed.

[stage-4] Running tests for Stage #4: pn5
[stage-4] Running ./spawn_shell.sh
[your-program] $
[stage-4] > invalid_command_1
[your-program] bash: invalid_command_1: command not found
[stage-4] ✓ Received command not found message
[your-program] $
[stage-4] > exit 0
[your-program] exit
[your-program] 
[stage-4] ✓ Program exited successfully
[stage-4] ✓ No output after exit command
[stage-4] Test passed.

[stage-3] Running tests for Stage #3: ff0
[stage-3] Running ./spawn_shell.sh
[your-program] $
[stage-3] > invalid_command_1
[your-program] bash: invalid_command_1: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] > invalid_command_2
[your-program] bash: invalid_command_2: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] > invalid_command_3
[your-program] bash: invalid_command_3: command not found
[stage-3] ✓ Received command not found message
[your-program] $
[stage-3] Test passed.

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./spawn_shell.sh
[your-program] $
[stage-2] > nonexistent
[your-program] bash: nonexistent: command not found
[stage-2] ✓ Received command not found message
[stage-2] Test passed.

[stage-1] Running tests for Stage #1: oo8
[stage-1] Running ./spawn_shell.sh
[your-program] $
[stage-1] ✓ Received prompt
[stage-1] Test passed.

0 comments on commit 7da7c06

Please sign in to comment.