diff --git a/42sh/21sh_error b/42sh/21sh_error new file mode 100644 index 00000000..4e43d0d5 --- /dev/null +++ b/42sh/21sh_error @@ -0,0 +1,235 @@ +.x....................xxx...xxxx..x. + +---------------------------------------------------------------- + +21sh/misc/002-simple-command-line (FAILED) + + Description: + The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`. + + Before test: + 01: rm -rf "./size" + 02: rm -rf "TOKEN201703241734" + 03: echo '^'$(echo TOKEN201703241734_FILE_TOKEN201703241734_STDOUT | wc -c)'$' > "./size" + + STDIN: + 01: mkdir TOKEN201703241734 ; cd TOKEN201703241734 ; touch TOKEN201703241734_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703241734_STDOUT ; cat TOKEN201703241734_STDOUT + + STDOUT: + SUCCESS expected_to match_regex `TOKEN201703241734_FILE$` + FAILURE expected_to match_each_regex_of_file `./size` + 01: TOKEN201703241734_FILE + 02: 98839 redirect_great.c 24 3 1 + 03: 23 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/001-creates-file-if-not-exits (FAILED) + + Description: + The right redirection `>` opens the file with the oflag `O_CREAT` so that the file is created if it does not exists. + + Before test: + 01: rm -f new_file + + STDIN: + 01: ./write_on_stdout TOKEN201703241734 >new_file + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241734` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241734` + FAILURE expected_to create_file `new_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/002-truncates-file-if-exists (FAILED) + + Description: + The right redirection `>` opens the file with the oflag `O_TRUNC` so that the file size is truncated to 0 before writing in it. + + Before test: + 01: ./write_on_stdout TOKEN201703241734_first >truncated_file + + STDIN: + 01: ./write_on_stdout TOKEN201703241734_second >truncated_file + + STDOUT: + SUCCESS expected_to_not match_regex TOKEN201703241734_second + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `truncated_file` matching_regex `TOKEN201703241734_second` + SUCCESS expected_to create_file `truncated_file` not_matching_regex `TOKEN201703241734_first` + FAILURE expected_to create_file `truncated_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/003-whitespace-before-filename (FAILED) + + Description: + The file name for a right redirection can be specified closely to the character `>` or in a separated field. + + Before test: + 01: rm -f "new_file" + + STDIN: + 01: ./write_on_stdout TOKEN201703241734 > new_file + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241734` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241734` + FAILURE expected_to create_file `new_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/multiple/004-together (FAILED) + + Description: + A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`. + + Before test: + 01: rm -f "new_file_stderr_and_stdout" + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241734_1 TOKEN201703241734_2 &>new_file_stderr_and_stdout + + STDOUT: + FAILURE expected_to_not match_regex `TOKEN201703241734_1` + SUCCESS expected_to_not match_regex `TOKEN201703241734_2` + 01: TOKEN201703241734_1 + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241734_1` + FAILURE expected_to_not match_regex `TOKEN201703241734_2` + 01: TOKEN201703241734_2 + + MISC: + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_2$` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces (FAILED) + + Description: + A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`. + In this test, we specify the file name in a separate field. + + Before test: + 01: rm -f new_file_stderr_and_stdout + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241734_1 TOKEN201703241734_2 &> new_file_stderr_and_stdout + + STDOUT: + FAILURE expected_to_not match_regex `TOKEN201703241734_1` + SUCCESS expected_to_not match_regex `TOKEN201703241734_2` + 01: TOKEN201703241734_1 + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241734_1` + FAILURE expected_to_not match_regex `TOKEN201703241734_2` + 01: TOKEN201703241734_2 + + MISC: + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241734_2$` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/stderr/001-works (FAILED) + + Description: + The purpose of this test is to check that redirecting the standard error STDERR to a file `2>` works. In this test, the binary writes a token on each standard and error output, so that only the STDOUT is outputted and STDERR is written in a file `new_file_stderr`. + + Before test: + 01: rm -f "./new_file_stderr" + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241734_STDOUT TOKEN201703241734_STDERR 2>new_file_stderr + + STDOUT: + SUCCESS expected_to match_regex `TOKEN201703241734_STDOUT` + 01: TOKEN201703241734_STDOUT + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241734_STDERR` + (no output) + + MISC: + SUCCESS expected_to create_file `new_file_stderr` matching_regex `TOKEN201703241734_STDERR` + FAILURE expected_to create_file `new_file_stderr` with_nb_of_lines 1 + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd (FAILED) + + Description: + The purpose of this test is to check if '1>' redirect STDIN to a file. + We are using echo with one argument. The output should NOT return anything on the standard output. + + Before test: + 01: rm -f new_file + + STDIN: + 01: /bin/echo TOKEN1 1>new_file + + STDOUT: + SUCCESS expected_to_not match_regex TOKEN1 + (no output) + + STDERR: + (no output) + + MISC: + SUCCESS expected_to create_file new_file matching_regex TOKEN1 + FAILURE expected_to create_file new_file with_nb_of_lines 1 + +---------------------------------------------------------------- + +21sh/separators/semicolon/003-parse-error-empty-inline-command (FAILED) + + Description: + The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error. + + STDIN: + 01: ./write_on_stdout TOKEN201703241734 ; ; ./exit_with_status 42 + + STDOUT: + SUCCESS expected_to be_empty + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error` + 01: syntax error near unexpected token `;' + + MISC: + SUCCESS expected_to_not exit_with_status `42` + FAILURE expected_to_not exit_with_status `0` + +Total tests: 36 +Total failed tests: 9 +Total pending tests: 0 diff --git a/42sh/42shelltest-tmp/.gitignore b/42sh/42ShellTester/.gitignore similarity index 100% rename from 42sh/42shelltest-tmp/.gitignore rename to 42sh/42ShellTester/.gitignore diff --git a/42sh/42shelltest-tmp/42ShellTester.sh b/42sh/42ShellTester/42ShellTester.sh similarity index 100% rename from 42sh/42shelltest-tmp/42ShellTester.sh rename to 42sh/42ShellTester/42ShellTester.sh diff --git a/42sh/42shelltest-tmp/README.md b/42sh/42ShellTester/README.md similarity index 96% rename from 42sh/42shelltest-tmp/README.md rename to 42sh/42ShellTester/README.md index 2d908aee..8746bd71 100644 --- a/42sh/42shelltest-tmp/README.md +++ b/42sh/42ShellTester/README.md @@ -8,7 +8,7 @@ It brings you an easy way to **add**, **maintain** and **run** integration tests, helping you to work step by step on your Shell implementation. -42ShellTester is currently packaged with **304 tests**. +42ShellTester is currently packaged with **289 tests**. ## Install @@ -302,25 +302,6 @@ Also display tests that succeed (hidden by default). * [002-it-works-2](spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/002-it-works-2) * **[variable-expansion/](spec/42sh/quoting/simple-quotes/mixed/variable-expansion)** * [001-expansion-disabled](spec/42sh/quoting/simple-quotes/mixed/variable-expansion/001-expansion-disabled) - * **[shellscript/](spec/42sh/shellscript)** - * **[if/](spec/42sh/shellscript/if)** - * [001-simple-if-1](spec/42sh/shellscript/if/001-simple-if-1) - * [002-simple-if-2](spec/42sh/shellscript/if/002-simple-if-2) - * [003-simple-if-3](spec/42sh/shellscript/if/003-simple-if-3) - * [004-nested-if](spec/42sh/shellscript/if/004-nested-if) - * [005-hard-nested-if](spec/42sh/shellscript/if/005-hard-nested-if) - * **[until/](spec/42sh/shellscript/until)** - * [001-simple-until-1](spec/42sh/shellscript/until/001-simple-until-1) - * [002-simple-until-2](spec/42sh/shellscript/until/002-simple-until-2) - * [003-simple-until-3](spec/42sh/shellscript/until/003-simple-until-3) - * [004-nested-until](spec/42sh/shellscript/until/004-nested-until) - * [005-hard-nested-until](spec/42sh/shellscript/until/005-hard-nested-until) - * **[while/](spec/42sh/shellscript/while)** - * [001-simple-while-1](spec/42sh/shellscript/while/001-simple-while-1) - * [002-simple-while-2](spec/42sh/shellscript/while/002-simple-while-2) - * [003-simple-while-3](spec/42sh/shellscript/while/003-simple-while-3) - * [004-nested-while](spec/42sh/shellscript/while/004-nested-while) - * [005-hard-nested-while](spec/42sh/shellscript/while/005-hard-nested-while) * **[subshell/](spec/42sh/subshell)** * [001-tokens-are-recognized](spec/42sh/subshell/001-tokens-are-recognized) * [002-multiple-levels-of-subshells](spec/42sh/subshell/002-multiple-levels-of-subshells) @@ -562,8 +543,6 @@ Find the available list of support binaries bellow: -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)**: A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)**: A binary that delete all files called in argument. * **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)**: A binary that iterates on `**envp` and write each element on standard output. * **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)**: A binary that writes its name on standard ouput. * **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)**: A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. @@ -593,4 +572,3 @@ Find the available list of support binaries bellow: Edouard Audeguy Illustrateur / Infographiste https://edouardaudeguy.wix.com/portfolio -# 42shelltest-tmp diff --git a/42sh/42shelltest-tmp/lib/assert.sh b/42sh/42ShellTester/lib/assert.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/assert.sh rename to 42sh/42ShellTester/lib/assert.sh diff --git a/42sh/42shelltest-tmp/lib/assets/42ShellTester.ascii b/42sh/42ShellTester/lib/assets/42ShellTester.ascii similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42ShellTester.ascii rename to 42sh/42ShellTester/lib/assets/42ShellTester.ascii diff --git a/42sh/42shelltest-tmp/lib/assets/42ShellTester.png b/42sh/42ShellTester/lib/assets/42ShellTester.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42ShellTester.png rename to 42sh/42ShellTester/lib/assets/42ShellTester.png diff --git a/42sh/42shelltest-tmp/lib/assets/42ShellTester_250x250.png b/42sh/42ShellTester/lib/assets/42ShellTester_250x250.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42ShellTester_250x250.png rename to 42sh/42ShellTester/lib/assets/42ShellTester_250x250.png diff --git a/42sh/42shelltest-tmp/lib/assets/42ShellTester_416x416.png b/42sh/42ShellTester/lib/assets/42ShellTester_416x416.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42ShellTester_416x416.png rename to 42sh/42ShellTester/lib/assets/42ShellTester_416x416.png diff --git a/42sh/42shelltest-tmp/lib/assets/42ShellTester_cropped.png b/42sh/42ShellTester/lib/assets/42ShellTester_cropped.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42ShellTester_cropped.png rename to 42sh/42ShellTester/lib/assets/42ShellTester_cropped.png diff --git a/42sh/42shelltest-tmp/lib/assets/42shTestsTeamLogo.png b/42sh/42ShellTester/lib/assets/42shTestsTeamLogo.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42shTestsTeamLogo.png rename to 42sh/42ShellTester/lib/assets/42shTestsTeamLogo.png diff --git a/42sh/42shelltest-tmp/lib/assets/42shTestsTeamLogo_sm.png b/42sh/42ShellTester/lib/assets/42shTestsTeamLogo_sm.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/42shTestsTeamLogo_sm.png rename to 42sh/42ShellTester/lib/assets/42shTestsTeamLogo_sm.png diff --git a/42sh/42shelltest-tmp/lib/assets/README.md b/42sh/42ShellTester/lib/assets/README.md similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/README.md rename to 42sh/42ShellTester/lib/assets/README.md diff --git a/42sh/42shelltest-tmp/lib/assets/hard.png b/42sh/42ShellTester/lib/assets/hard.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/hard.png rename to 42sh/42ShellTester/lib/assets/hard.png diff --git a/42sh/42shelltest-tmp/lib/assets/non-posix.png b/42sh/42ShellTester/lib/assets/non-posix.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/non-posix.png rename to 42sh/42ShellTester/lib/assets/non-posix.png diff --git a/42sh/42shelltest-tmp/lib/assets/pending.png b/42sh/42ShellTester/lib/assets/pending.png similarity index 100% rename from 42sh/42shelltest-tmp/lib/assets/pending.png rename to 42sh/42ShellTester/lib/assets/pending.png diff --git a/42sh/42shelltest-tmp/lib/main.sh b/42sh/42ShellTester/lib/main.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/main.sh rename to 42sh/42ShellTester/lib/main.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/be_empty.sh b/42sh/42ShellTester/lib/verbs/be_empty.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/be_empty.sh rename to 42sh/42ShellTester/lib/verbs/be_empty.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/create_file.sh b/42sh/42ShellTester/lib/verbs/create_file.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/create_file.sh rename to 42sh/42ShellTester/lib/verbs/create_file.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/exit_with_status.sh b/42sh/42ShellTester/lib/verbs/exit_with_status.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/exit_with_status.sh rename to 42sh/42ShellTester/lib/verbs/exit_with_status.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/have_nb_of_lines.sh b/42sh/42ShellTester/lib/verbs/have_nb_of_lines.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/have_nb_of_lines.sh rename to 42sh/42ShellTester/lib/verbs/have_nb_of_lines.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/match_each_regex_of_file.sh b/42sh/42ShellTester/lib/verbs/match_each_regex_of_file.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/match_each_regex_of_file.sh rename to 42sh/42ShellTester/lib/verbs/match_each_regex_of_file.sh diff --git a/42sh/42shelltest-tmp/lib/verbs/match_regex.sh b/42sh/42ShellTester/lib/verbs/match_regex.sh similarity index 100% rename from 42sh/42shelltest-tmp/lib/verbs/match_regex.sh rename to 42sh/42ShellTester/lib/verbs/match_regex.sh diff --git a/42sh/42ShellTester/log b/42sh/42ShellTester/log new file mode 100644 index 00000000..4bca6790 --- /dev/null +++ b/42sh/42ShellTester/log @@ -0,0 +1,235 @@ +.x....................xxx...xxxx..x. + +---------------------------------------------------------------- + +21sh/misc/002-simple-command-line (FAILED) + + Description: + The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`. + + Before test: + 01: rm -rf "./size" + 02: rm -rf "TOKEN201703241733" + 03: echo '^'$(echo TOKEN201703241733_FILE_TOKEN201703241733_STDOUT | wc -c)'$' > "./size" + + STDIN: + 01: mkdir TOKEN201703241733 ; cd TOKEN201703241733 ; touch TOKEN201703241733_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703241733_STDOUT ; cat TOKEN201703241733_STDOUT + + STDOUT: + SUCCESS expected_to match_regex `TOKEN201703241733_FILE$` + FAILURE expected_to match_each_regex_of_file `./size` + 01: TOKEN201703241733_FILE + 02: 94296 redirect_great.c 24 3 1 + 03: 23 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/001-creates-file-if-not-exits (FAILED) + + Description: + The right redirection `>` opens the file with the oflag `O_CREAT` so that the file is created if it does not exists. + + Before test: + 01: rm -f new_file + + STDIN: + 01: ./write_on_stdout TOKEN201703241733 >new_file + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241733` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241733` + FAILURE expected_to create_file `new_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/002-truncates-file-if-exists (FAILED) + + Description: + The right redirection `>` opens the file with the oflag `O_TRUNC` so that the file size is truncated to 0 before writing in it. + + Before test: + 01: ./write_on_stdout TOKEN201703241733_first >truncated_file + + STDIN: + 01: ./write_on_stdout TOKEN201703241733_second >truncated_file + + STDOUT: + SUCCESS expected_to_not match_regex TOKEN201703241733_second + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `truncated_file` matching_regex `TOKEN201703241733_second` + SUCCESS expected_to create_file `truncated_file` not_matching_regex `TOKEN201703241733_first` + FAILURE expected_to create_file `truncated_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/003-whitespace-before-filename (FAILED) + + Description: + The file name for a right redirection can be specified closely to the character `>` or in a separated field. + + Before test: + 01: rm -f "new_file" + + STDIN: + 01: ./write_on_stdout TOKEN201703241733 > new_file + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241733` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + SUCCESS expected_to create_file `new_file` matching_regex `TOKEN201703241733` + FAILURE expected_to create_file `new_file` with_nb_of_lines `1` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/multiple/004-together (FAILED) + + Description: + A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`. + + Before test: + 01: rm -f "new_file_stderr_and_stdout" + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241733_1 TOKEN201703241733_2 &>new_file_stderr_and_stdout + + STDOUT: + FAILURE expected_to_not match_regex `TOKEN201703241733_1` + SUCCESS expected_to_not match_regex `TOKEN201703241733_2` + 01: TOKEN201703241733_1 + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241733_1` + FAILURE expected_to_not match_regex `TOKEN201703241733_2` + 01: TOKEN201703241733_2 + + MISC: + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241733_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241733_2$` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces (FAILED) + + Description: + A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`. + In this test, we specify the file name in a separate field. + + Before test: + 01: rm -f new_file_stderr_and_stdout + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241733_1 TOKEN201703241733_2 &> new_file_stderr_and_stdout + + STDOUT: + FAILURE expected_to_not match_regex `TOKEN201703241733_1` + SUCCESS expected_to_not match_regex `TOKEN201703241733_2` + 01: TOKEN201703241733_1 + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241733_1` + FAILURE expected_to_not match_regex `TOKEN201703241733_2` + 01: TOKEN201703241733_2 + + MISC: + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241733_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703241733_2$` + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/stderr/001-works (FAILED) + + Description: + The purpose of this test is to check that redirecting the standard error STDERR to a file `2>` works. In this test, the binary writes a token on each standard and error output, so that only the STDOUT is outputted and STDERR is written in a file `new_file_stderr`. + + Before test: + 01: rm -f "./new_file_stderr" + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703241733_STDOUT TOKEN201703241733_STDERR 2>new_file_stderr + + STDOUT: + SUCCESS expected_to match_regex `TOKEN201703241733_STDOUT` + 01: TOKEN201703241733_STDOUT + + STDERR: + SUCCESS expected_to_not match_regex `TOKEN201703241733_STDERR` + (no output) + + MISC: + SUCCESS expected_to create_file `new_file_stderr` matching_regex `TOKEN201703241733_STDERR` + FAILURE expected_to create_file `new_file_stderr` with_nb_of_lines 1 + +---------------------------------------------------------------- + +21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd (FAILED) + + Description: + The purpose of this test is to check if '1>' redirect STDIN to a file. + We are using echo with one argument. The output should NOT return anything on the standard output. + + Before test: + 01: rm -f new_file + + STDIN: + 01: /bin/echo TOKEN1 1>new_file + + STDOUT: + SUCCESS expected_to_not match_regex TOKEN1 + (no output) + + STDERR: + (no output) + + MISC: + SUCCESS expected_to create_file new_file matching_regex TOKEN1 + FAILURE expected_to create_file new_file with_nb_of_lines 1 + +---------------------------------------------------------------- + +21sh/separators/semicolon/003-parse-error-empty-inline-command (FAILED) + + Description: + The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error. + + STDIN: + 01: ./write_on_stdout TOKEN201703241733 ; ; ./exit_with_status 42 + + STDOUT: + SUCCESS expected_to be_empty + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error` + 01: syntax error near unexpected token `;' + + MISC: + SUCCESS expected_to_not exit_with_status `42` + FAILURE expected_to_not exit_with_status `0` + +Total tests: 36 +Total failed tests: 9 +Total pending tests: 0 diff --git a/42sh/42shelltest-tmp/spec/README.md b/42sh/42ShellTester/spec/README.md similarity index 100% rename from 42sh/42shelltest-tmp/spec/README.md rename to 42sh/42ShellTester/spec/README.md diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/pending b/42sh/42ShellTester/spec/minishell_error similarity index 100% rename from 42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/pending rename to 42sh/42ShellTester/spec/minishell_error diff --git a/42sh/42shelltest-tmp/support/Makefile b/42sh/42ShellTester/support/Makefile similarity index 85% rename from 42sh/42shelltest-tmp/support/Makefile rename to 42sh/42ShellTester/support/Makefile index a6f36b46..f8aeae9c 100644 --- a/42sh/42shelltest-tmp/support/Makefile +++ b/42sh/42ShellTester/support/Makefile @@ -12,8 +12,6 @@ all: make TARGET_DIR=$(TARGET_DIR) -C ./write-on-stderr make TARGET_DIR=$(TARGET_DIR) -C ./write-on-stdout make TARGET_DIR=$(TARGET_DIR) -C ./write-on-stdout-and-stderr - make TARGET_DIR=$(TARGET_DIR) -C ./create-file - make TARGET_DIR=$(TARGET_DIR) -C ./delete-file re: fclean all @@ -27,5 +25,5 @@ fclean: make TARGET_DIR=$(TARGET_DIR) fclean -C ./sleep-and-write-on-stderr make TARGET_DIR=$(TARGET_DIR) fclean -C ./write-all-arguments-on-stdout make TARGET_DIR=$(TARGET_DIR) fclean -C ./write-on-stderr - make TARGET_DIR=$(TARGET_DIR) fclean -C ./create-file - make TARGET_DIR=$(TARGET_DIR) fclean -C ./delete-file + make TARGET_DIR=$(TARGET_DIR) fclean -C ./write-on-stdout + make TARGET_DIR=$(TARGET_DIR) fclean -C ./write-on-stdout-and-stderr diff --git a/42sh/42shelltest-tmp/support/display-env/Makefile b/42sh/42ShellTester/support/display-env/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/display-env/Makefile rename to 42sh/42ShellTester/support/display-env/Makefile diff --git a/42sh/42shelltest-tmp/support/display-env/README.md b/42sh/42ShellTester/support/display-env/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/display-env/README.md rename to 42sh/42ShellTester/support/display-env/README.md diff --git a/42sh/42shelltest-tmp/support/display-env/description b/42sh/42ShellTester/support/display-env/description similarity index 100% rename from 42sh/42shelltest-tmp/support/display-env/description rename to 42sh/42ShellTester/support/display-env/description diff --git a/42sh/42shelltest-tmp/support/display-env/main.c b/42sh/42ShellTester/support/display-env/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/display-env/main.c rename to 42sh/42ShellTester/support/display-env/main.c diff --git a/42sh/42shelltest-tmp/support/display-program-name/Makefile b/42sh/42ShellTester/support/display-program-name/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/display-program-name/Makefile rename to 42sh/42ShellTester/support/display-program-name/Makefile diff --git a/42sh/42shelltest-tmp/support/display-program-name/README.md b/42sh/42ShellTester/support/display-program-name/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/display-program-name/README.md rename to 42sh/42ShellTester/support/display-program-name/README.md diff --git a/42sh/42shelltest-tmp/support/display-program-name/description b/42sh/42ShellTester/support/display-program-name/description similarity index 100% rename from 42sh/42shelltest-tmp/support/display-program-name/description rename to 42sh/42ShellTester/support/display-program-name/description diff --git a/42sh/42shelltest-tmp/support/display-program-name/main.c b/42sh/42ShellTester/support/display-program-name/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/display-program-name/main.c rename to 42sh/42ShellTester/support/display-program-name/main.c diff --git a/42sh/42shelltest-tmp/support/display-pwd/Makefile b/42sh/42ShellTester/support/display-pwd/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/display-pwd/Makefile rename to 42sh/42ShellTester/support/display-pwd/Makefile diff --git a/42sh/42shelltest-tmp/support/display-pwd/README.md b/42sh/42ShellTester/support/display-pwd/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/display-pwd/README.md rename to 42sh/42ShellTester/support/display-pwd/README.md diff --git a/42sh/42shelltest-tmp/support/display-pwd/description b/42sh/42ShellTester/support/display-pwd/description similarity index 100% rename from 42sh/42shelltest-tmp/support/display-pwd/description rename to 42sh/42ShellTester/support/display-pwd/description diff --git a/42sh/42shelltest-tmp/support/display-pwd/main.c b/42sh/42ShellTester/support/display-pwd/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/display-pwd/main.c rename to 42sh/42ShellTester/support/display-pwd/main.c diff --git a/42sh/42shelltest-tmp/support/exit-with-status/Makefile b/42sh/42ShellTester/support/exit-with-status/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/exit-with-status/Makefile rename to 42sh/42ShellTester/support/exit-with-status/Makefile diff --git a/42sh/42shelltest-tmp/support/exit-with-status/README.md b/42sh/42ShellTester/support/exit-with-status/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/exit-with-status/README.md rename to 42sh/42ShellTester/support/exit-with-status/README.md diff --git a/42sh/42shelltest-tmp/support/exit-with-status/description b/42sh/42ShellTester/support/exit-with-status/description similarity index 100% rename from 42sh/42shelltest-tmp/support/exit-with-status/description rename to 42sh/42ShellTester/support/exit-with-status/description diff --git a/42sh/42shelltest-tmp/support/exit-with-status/main.c b/42sh/42ShellTester/support/exit-with-status/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/exit-with-status/main.c rename to 42sh/42ShellTester/support/exit-with-status/main.c diff --git a/42sh/42shelltest-tmp/support/read-on-stdin/Makefile b/42sh/42ShellTester/support/read-on-stdin/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/read-on-stdin/Makefile rename to 42sh/42ShellTester/support/read-on-stdin/Makefile diff --git a/42sh/42shelltest-tmp/support/read-on-stdin-once/README.md b/42sh/42ShellTester/support/read-on-stdin/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/read-on-stdin-once/README.md rename to 42sh/42ShellTester/support/read-on-stdin/README.md diff --git a/42sh/42shelltest-tmp/support/read-on-stdin/description b/42sh/42ShellTester/support/read-on-stdin/description similarity index 100% rename from 42sh/42shelltest-tmp/support/read-on-stdin/description rename to 42sh/42ShellTester/support/read-on-stdin/description diff --git a/42sh/42shelltest-tmp/support/read-on-stdin/main.c b/42sh/42ShellTester/support/read-on-stdin/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/read-on-stdin/main.c rename to 42sh/42ShellTester/support/read-on-stdin/main.c diff --git a/42sh/42shelltest-tmp/support/sleep-and-exit-with-status/Makefile b/42sh/42ShellTester/support/sleep-and-exit-with-status/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-exit-with-status/Makefile rename to 42sh/42ShellTester/support/sleep-and-exit-with-status/Makefile diff --git a/42sh/42shelltest-tmp/support/sleep-and-exit-with-status/README.md b/42sh/42ShellTester/support/sleep-and-exit-with-status/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-exit-with-status/README.md rename to 42sh/42ShellTester/support/sleep-and-exit-with-status/README.md diff --git a/42sh/42shelltest-tmp/support/sleep-and-exit-with-status/description b/42sh/42ShellTester/support/sleep-and-exit-with-status/description similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-exit-with-status/description rename to 42sh/42ShellTester/support/sleep-and-exit-with-status/description diff --git a/42sh/42shelltest-tmp/support/sleep-and-exit-with-status/main.c b/42sh/42ShellTester/support/sleep-and-exit-with-status/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-exit-with-status/main.c rename to 42sh/42ShellTester/support/sleep-and-exit-with-status/main.c diff --git a/42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/Makefile b/42sh/42ShellTester/support/sleep-and-write-on-stderr/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/Makefile rename to 42sh/42ShellTester/support/sleep-and-write-on-stderr/Makefile diff --git a/42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/README.md b/42sh/42ShellTester/support/sleep-and-write-on-stderr/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/README.md rename to 42sh/42ShellTester/support/sleep-and-write-on-stderr/README.md diff --git a/42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/description b/42sh/42ShellTester/support/sleep-and-write-on-stderr/description similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/description rename to 42sh/42ShellTester/support/sleep-and-write-on-stderr/description diff --git a/42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/main.c b/42sh/42ShellTester/support/sleep-and-write-on-stderr/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/sleep-and-write-on-stderr/main.c rename to 42sh/42ShellTester/support/sleep-and-write-on-stderr/main.c diff --git a/42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/Makefile b/42sh/42ShellTester/support/write-all-arguments-on-stdout/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/Makefile rename to 42sh/42ShellTester/support/write-all-arguments-on-stdout/Makefile diff --git a/42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/README.md b/42sh/42ShellTester/support/write-all-arguments-on-stdout/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/README.md rename to 42sh/42ShellTester/support/write-all-arguments-on-stdout/README.md diff --git a/42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/description b/42sh/42ShellTester/support/write-all-arguments-on-stdout/description similarity index 100% rename from 42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/description rename to 42sh/42ShellTester/support/write-all-arguments-on-stdout/description diff --git a/42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/main.c b/42sh/42ShellTester/support/write-all-arguments-on-stdout/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/write-all-arguments-on-stdout/main.c rename to 42sh/42ShellTester/support/write-all-arguments-on-stdout/main.c diff --git a/42sh/42shelltest-tmp/support/write-on-stderr/Makefile b/42sh/42ShellTester/support/write-on-stderr/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stderr/Makefile rename to 42sh/42ShellTester/support/write-on-stderr/Makefile diff --git a/42sh/42shelltest-tmp/support/write-on-stderr/README.md b/42sh/42ShellTester/support/write-on-stderr/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stderr/README.md rename to 42sh/42ShellTester/support/write-on-stderr/README.md diff --git a/42sh/42shelltest-tmp/support/write-on-stderr/description b/42sh/42ShellTester/support/write-on-stderr/description similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stderr/description rename to 42sh/42ShellTester/support/write-on-stderr/description diff --git a/42sh/42shelltest-tmp/support/write-on-stderr/main.c b/42sh/42ShellTester/support/write-on-stderr/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stderr/main.c rename to 42sh/42ShellTester/support/write-on-stderr/main.c diff --git a/42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/Makefile b/42sh/42ShellTester/support/write-on-stdout-and-stderr/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/Makefile rename to 42sh/42ShellTester/support/write-on-stdout-and-stderr/Makefile diff --git a/42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/README.md b/42sh/42ShellTester/support/write-on-stdout-and-stderr/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/README.md rename to 42sh/42ShellTester/support/write-on-stdout-and-stderr/README.md diff --git a/42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/description b/42sh/42ShellTester/support/write-on-stdout-and-stderr/description similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/description rename to 42sh/42ShellTester/support/write-on-stdout-and-stderr/description diff --git a/42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/main.c b/42sh/42ShellTester/support/write-on-stdout-and-stderr/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout-and-stderr/main.c rename to 42sh/42ShellTester/support/write-on-stdout-and-stderr/main.c diff --git a/42sh/42shelltest-tmp/support/write-on-stdout/Makefile b/42sh/42ShellTester/support/write-on-stdout/Makefile similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout/Makefile rename to 42sh/42ShellTester/support/write-on-stdout/Makefile diff --git a/42sh/42shelltest-tmp/support/write-on-stdout/README.md b/42sh/42ShellTester/support/write-on-stdout/README.md similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout/README.md rename to 42sh/42ShellTester/support/write-on-stdout/README.md diff --git a/42sh/42shelltest-tmp/support/write-on-stdout/description b/42sh/42ShellTester/support/write-on-stdout/description similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout/description rename to 42sh/42ShellTester/support/write-on-stdout/description diff --git a/42sh/42shelltest-tmp/support/write-on-stdout/main.c b/42sh/42ShellTester/support/write-on-stdout/main.c similarity index 100% rename from 42sh/42shelltest-tmp/support/write-on-stdout/main.c rename to 42sh/42ShellTester/support/write-on-stdout/main.c diff --git a/42sh/42shelltest-tmp/tasks/generate_readmes.sh b/42sh/42ShellTester/tasks/generate_readmes.sh similarity index 100% rename from 42sh/42shelltest-tmp/tasks/generate_readmes.sh rename to 42sh/42ShellTester/tasks/generate_readmes.sh diff --git a/42sh/42sh_error b/42sh/42sh_error new file mode 100644 index 00000000..6455094c --- /dev/null +++ b/42sh/42sh_error @@ -0,0 +1,2501 @@ +x.xxx..x.xxx.xx.xxx......xxxxx...xxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx.xx.xxx.x......xxxx.xxxxxx...xxxx...........xxxxxx.................xx...... + +---------------------------------------------------------------- + +42sh/builtins/export/001-display-env (FAILED) + + Description: + The purpose of this test is to check that using the builtin `export` without parameters results at least in a display of the environment variables. + + Before test: + 01: rm -rf "./stored_env" + 02: env | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" + + STDIN: + 01: export + + STDOUT: + FAILURE expected_to match_each_regex_of_file `./stored_env` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/003-export-basic-key-value-2 (FAILED) + + Description: + The purpose of this test is to check that the builtin `export` may declare a new environment variable and is able to display it later. + + Before test: + 01: unset "TOKEN201703241737_NAME" + + STDIN: + 01: export TOKEN201703241737_NAME=TOKEN201703241737_VALUE + 02: export + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_NAME=["]?TOKEN201703241737_VALUE["]?$` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/004-export-empty-variable-1 (FAILED) + + Description: + The purpose of this test is to check that exporting an empty variable does not add it to the environment. + + Before test: + 01: unset "TOKEN201703241737" + + STDIN: + 01: export TOKEN201703241737 + 02: ./display_env + + STDOUT: + FAILURE expected_to_not match_regex `TOKEN201703241737` + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TERM=screen-256color + 04: SHELL=/bin/zsh + 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 10: ZSH=/Users/ariard/.oh-my-zsh + 11: USER=ariard + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 14: PAGER=less + 15: TMUX=/private/tmp/tmux-18965/default,73780,2 + 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 17: LSCOLORS=Gxfxcxdxbxegedabagacad + 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 19: MAIL=ariard@student.42.fr + 20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 21: LANG=en_US.UTF-8 + 22: ITERM_PROFILE=Default + 23: XPC_FLAGS=0x0 + 24: TMUX_PANE=%9 + 25: XPC_SERVICE_NAME=0 + 26: SHLVL=4 + 27: HOME=/Users/ariard + 28: COLORFGBG=7;0 + 29: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 30: LOGNAME=ariard + 31: LESS=-R + 32: LC_CTYPE=en_US.UTF-8 + 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 35: _=../../42sh + 36: ?=0 + 37: TOKEN201703241737= + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 36 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/005-export-empty-variable-2 (FAILED) + + Description: + The purpose of this test is to check that exporting an empty variable does not add it to the environment, but can be displayed with the builtin `export`. + + Before test: + 01: unset "TOKEN201703241737" + + STDIN: + 01: export TOKEN201703241737 + 02: export + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/008-local-to-environment (FAILED) + + Description: + The purpose of this test is to check that a declared local variable may be exported to the environment with the builtin `export`. + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + 02: export TOKEN201703241737_NAME + 03: ./display_env + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE$` + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TERM=screen-256color + 04: SHELL=/bin/zsh + 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 10: ZSH=/Users/ariard/.oh-my-zsh + 11: USER=ariard + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 14: PAGER=less + 15: TMUX=/private/tmp/tmux-18965/default,73780,2 + 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 17: LSCOLORS=Gxfxcxdxbxegedabagacad + 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 19: MAIL=ariard@student.42.fr + 20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 21: LANG=en_US.UTF-8 + 22: ITERM_PROFILE=Default + 23: XPC_FLAGS=0x0 + 24: TMUX_PANE=%9 + 25: XPC_SERVICE_NAME=0 + 26: SHLVL=4 + 27: HOME=/Users/ariard + 28: COLORFGBG=7;0 + 29: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 30: LOGNAME=ariard + 31: LESS=-R + 32: LC_CTYPE=en_US.UTF-8 + 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 35: _=../../42sh + 36: ?=0 + 37: TOKEN201703241737_NAME=OKEN201703241737_VALUE + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 36 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/010-export-with-equal-but-no-value-part2 (FAILED) + + Description: + The purpose of this test is to check if the builtin export works fine with equal sign but no value. This test is based on the local variables return. + + Before test: + 01: unset "TOKEN201703241737" + + STDIN: + 01: export TOKEN201703241737_NAME= + 02: export + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_NAME=` + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/errors/001-invalid-identifier-1 (FAILED) + + Description: + The purpose of this test is to check that trying to export an invalid variable identifier results in error. + + STDIN: + 01: export 42=TOKEN201703241737 + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241737` + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `(not.*identifier|must begin.*letter)` + 01: ../../42sh: export: 42: invalid variable name + + MISC: + FAILURE expected_to_not exit_with_status `0` + +---------------------------------------------------------------- + +42sh/builtins/export/errors/002-invalid-identifier-2 (FAILED) + + Description: + The purpose of this test is to check that trying to export an invalid variable identifier results in error. + + STDIN: + 01: export .=TOKEN201703241737 + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241737` + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `(not.*identifier|must begin.*letter)` + 01: ../../42sh: export: .: invalid variable name + + MISC: + FAILURE expected_to_not exit_with_status `0` + +---------------------------------------------------------------- + +42sh/builtins/export/mixed/001-export-and-tmp-env-part1 (FAILED) + + Description: + The purpose of this test is to check that modifying the environment for the builtin `export` results in an added variable into the exported list. + + Before test: + 01: unset "TOKEN201703241737_NAME" + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE export TOKEN201703241737_NAME + 02: export + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_NAME=["]?TOKEN201703241737_VALUE["]?` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: command not found: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + +---------------------------------------------------------------- + +42sh/builtins/export/mixed/002-export-and-tmp-env-part2 (FAILED) + + Description: + The purpose of this test is to check that modifying the environment for the builtin `export` results in an added environment variable. + + Before test: + 01: unset "TOKEN201703241737_NAME" + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE export TOKEN201703241737_NAME + 02: ./display_env + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_NAME=TOKEN201703241737_VALUE` + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TERM=screen-256color + 04: SHELL=/bin/zsh + 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 10: ZSH=/Users/ariard/.oh-my-zsh + 11: USER=ariard + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 14: PAGER=less + 15: TMUX=/private/tmp/tmux-18965/default,73780,2 + 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 17: LSCOLORS=Gxfxcxdxbxegedabagacad + 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 19: MAIL=ariard@student.42.fr + 20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 21: LANG=en_US.UTF-8 + 22: ITERM_PROFILE=Default + 23: XPC_FLAGS=0x0 + 24: TMUX_PANE=%9 + 25: XPC_SERVICE_NAME=0 + 26: SHLVL=4 + 27: HOME=/Users/ariard + 28: COLORFGBG=7;0 + 29: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 30: LOGNAME=ariard + 31: LESS=-R + 32: LC_CTYPE=en_US.UTF-8 + 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 35: _=../../42sh + 36: ?=127 + 37: ------------------------------ + 38: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: command not found: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + +---------------------------------------------------------------- + +42sh/builtins/export/options/002-export-p-param-and-token-should-add-local-var-only-part1 (FAILED) + + Description: + The purpose of this test is to check if export with -p option + token , add the variable into export list but not in env list. And don't display the export variable on stdout. + + Before test: + 01: rm -f "./stored_env" + 02: unset "TOKEN201703241737_NAME" + 03: export | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" + + STDIN: + 01: export -p TOKEN201703241737_NAME + 02: export + + STDOUT: + FAILURE expected_to_not match_each_regex_of_file `./stored_env` + FAILURE expected_to match_regex `TOKEN201703241737_NAME` + 01: export TERM_PROGRAM=iTerm.app + 02: export TERM=screen-256color + 03: export SHELL=/bin/zsh + 04: export HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 05: export TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 07: export TERM_PROGRAM_VERSION=3.0.10 + 08: export TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 09: export ZSH=/Users/ariard/.oh-my-zsh + 10: export USER=ariard + 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 12: export __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 13: export PAGER=less + 14: export TMUX=/private/tmp/tmux-18965/default,73780,2 + 15: export HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 16: export LSCOLORS=Gxfxcxdxbxegedabagacad + 17: export PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 18: export MAIL=ariard@student.42.fr + 19: export PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 20: export LANG=en_US.UTF-8 + 21: export ITERM_PROFILE=Default + 22: export XPC_FLAGS=0x0 + 23: export TMUX_PANE=%9 + 24: export XPC_SERVICE_NAME=0 + 25: export SHLVL=4 + 26: export HOME=/Users/ariard + 27: export COLORFGBG=7;0 + 28: export ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 29: export LOGNAME=ariard + 30: export LESS=-R + 31: export LC_CTYPE=en_US.UTF-8 + 32: export TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 33: export OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 34: export _=../../42sh + 35: export ?=0 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/options/003-export-p-param-and-token-should-add-local-var-only-part2 (FAILED) + + Description: + The purpose of this test is to check that the builtin `export` with option `-p` results in an added variable into the export list but not from the environment. + + Before test: + 01: rm -f "./stored_env" + 02: unset "TOKEN201703241737_NAME" + 03: export | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" + + STDIN: + 01: export -p TOKEN201703241737_NAME + 02: ./display_env + + STDOUT: + FAILURE expected_to_not match_each_regex_of_file `./stored_env` + SUCCESS expected_to_not match_regex `TOKEN201703241737_NAME` + 01: export TERM_PROGRAM=iTerm.app + 02: export TERM=screen-256color + 03: export SHELL=/bin/zsh + 04: export HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 05: export TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 07: export TERM_PROGRAM_VERSION=3.0.10 + 08: export TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 09: export ZSH=/Users/ariard/.oh-my-zsh + 10: export USER=ariard + 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 12: export __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 13: export PAGER=less + 14: export TMUX=/private/tmp/tmux-18965/default,73780,2 + 15: export HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 16: export LSCOLORS=Gxfxcxdxbxegedabagacad + 17: export PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 18: export MAIL=ariard@student.42.fr + 19: export PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 20: export LANG=en_US.UTF-8 + 21: export ITERM_PROFILE=Default + 22: export XPC_FLAGS=0x0 + 23: export TMUX_PANE=%9 + 24: export XPC_SERVICE_NAME=0 + 25: export SHLVL=4 + 26: export HOME=/Users/ariard + 27: export COLORFGBG=7;0 + 28: export ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 29: export LOGNAME=ariard + 30: export LESS=-R + 31: export LC_CTYPE=en_US.UTF-8 + 32: export TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 33: export OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 34: export _=../../42sh + 35: export ?=0 + 36: ------------------------------ + 37: TERM_PROGRAM=iTerm.app + 38: TERM=screen-256color + 39: SHELL=/bin/zsh + 40: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 41: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 42: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 43: TERM_PROGRAM_VERSION=3.0.10 + 44: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 45: ZSH=/Users/ariard/.oh-my-zsh + 46: USER=ariard + 47: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 48: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 49: PAGER=less + 50: TMUX=/private/tmp/tmux-18965/default,73780,2 + 51: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 52: LSCOLORS=Gxfxcxdxbxegedabagacad + 53: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 54: MAIL=ariard@student.42.fr + 55: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 56: LANG=en_US.UTF-8 + 57: ITERM_PROFILE=Default + 58: XPC_FLAGS=0x0 + 59: TMUX_PANE=%9 + 60: XPC_SERVICE_NAME=0 + 61: SHLVL=4 + 62: HOME=/Users/ariard + 63: COLORFGBG=7;0 + 64: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 65: LOGNAME=ariard + 66: LESS=-R + 67: LC_CTYPE=en_US.UTF-8 + 68: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 69: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 70: _=../../42sh + 71: ?=0 + 72: ------------------------------ + 73: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/builtins/export/options/004-export-n-param (FAILED) + + Description: + The purpose of this test is to check that using the builtin `export` with option `-n` results in a removed environment variable. + + Before test: + 01: export TOKEN201703241737_NAME=TOKEN201703241737_VALUE + + STDIN: + 01: export -n TOKEN201703241737_NAME + 02: export + 03: ./display_env + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241737_NAME` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: export: invalid option -n + 02: ./lib/main.sh: line 102: 12935 Segmentation fault: 11 ../../42sh + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/brace-expansion/002-it-expands-braces-1 (FAILED) + + Description: + The purpose of this test is to check that using multiple escape characters `\\` results in a good behavior with the brace expansion. + + STDIN: + 01: ./write_all_arguments_on_stdout \\{1..2} + + STDOUT: + FAILURE expected_to match_regex `^\1@\2@$` + 01: \{1..2}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/brace-expansion/003-it-expands-braces-2 (FAILED) + + Description: + The purpose of this test is to check that using multiple escape characters `\\` results in a good behavior with the brace expansion. + + STDIN: + 01: ./write_all_arguments_on_stdout \\\{1..2} \\\\{1..2} \\\\\{1..2} \\\\\\{1..2} + + STDOUT: + FAILURE expected_to match_regex `^\[{]1..2}@\\1@\\2@\\[{]1..2}@\\\1@\\\2@$` + 01: \{1..2}@\\{1..2}@\\{1..2}@\\\{1..2}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets (FAILED) + + Description: + The purpose of this test is to check that escaping brackets does not result in an expansion process. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout \[abc] [abc\] \[abc\] + + STDOUT: + FAILURE expected_to match_regex `^[[]abc]@[[]abc]@[[]abc]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/bracket-expansion/002-escaped-inversion-mark (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with an inversion mark `!` or `^` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' '!' '^' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [\!abc] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [\^abc] + + STDOUT: + FAILURE expected_to match_regex `!@` + FAILURE expected_to match_regex `[\^]@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + SUCCESS expected_to_not match_regex `d@` + SUCCESS expected_to_not match_regex `e@` + SUCCESS expected_to_not match_regex `f@` + WARNING might match_regex `^!@a@b@c@$` + WARNING might match_regex `^[\^]@a@b@c@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/bracket-expansion/003-it-takes-escaped-bracket-as-pattern-character (FAILED) + + Description: + The purpose of this test is to check that a closing bracket ']' may be escaped in a backet expansion pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' ']' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [abc\]def] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [abc\\\]def] + 03: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [abc\\\\\]def] + 04: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [abc\\\\\\\]def] + + STDOUT: + FAILURE expected_to match_regex `a@` 4 times + FAILURE expected_to match_regex `b@` 4 times + FAILURE expected_to match_regex `c@` 4 times + FAILURE expected_to match_regex `]@` 4 times + FAILURE expected_to match_regex `d@` 4 times + FAILURE expected_to match_regex `e@` 4 times + FAILURE expected_to match_regex `f@` 4 times + SUCCESS expected_to_not match_regex `def` + WARNING might match_regex `^]@a@b@c@d@e@f@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {a..e} + + STDOUT: + FAILURE expected_to match_regex `^a@b@c@d@e@$` + 01: {a..e}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/002-simple-ascending-2 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{a..e}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737aTOKEN201703241737@TOKEN201703241737bTOKEN201703241737@TOKEN201703241737cTOKEN201703241737@TOKEN201703241737dTOKEN201703241737@TOKEN201703241737eTOKEN201703241737@$` + 01: TOKEN201703241737{a..e}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/003-simple-ascending-3 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {A..E} + + STDOUT: + FAILURE expected_to match_regex `^A@B@C@D@E@$` + 01: {A..E}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/004-simple-descending-1 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {E..A} + + STDOUT: + FAILURE expected_to match_regex `^E@D@C@B@A@$` + 01: {E..A}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/005-simple-descending-2 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{E..A}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737ETOKEN201703241737@TOKEN201703241737DTOKEN201703241737@TOKEN201703241737CTOKEN201703241737@TOKEN201703241737BTOKEN201703241737@TOKEN201703241737ATOKEN201703241737@$` + 01: TOKEN201703241737{E..A}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/006-simple-descending-3 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with an ASCII range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{e..a} + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737e@TOKEN201703241737d@TOKEN201703241737c@TOKEN201703241737b@TOKEN201703241737a@$` + 01: TOKEN201703241737{e..a}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/007-identical-start-and-end (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a range of single ASCII value. + + STDIN: + 01: ./write_all_arguments_on_stdout {f..f} + + STDOUT: + FAILURE expected_to match_regex `^f@$` + 01: {f..f}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/008-multiple-1 (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. + + STDIN: + 01: ./write_all_arguments_on_stdout {a..b}{c..d}{e..f} + + STDOUT: + FAILURE expected_to match_regex `^ace@acf@ade@adf@bce@bcf@bde@bdf@$` + 01: {a..b}{c..d}{e..f}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/009-multiple-2 (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{a..b}abc{Z..X}def{s..s} + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737aabcZdefs@TOKEN201703241737aabcYdefs@TOKEN201703241737aabcXdefs@TOKEN201703241737babcZdefs@TOKEN201703241737babcYdefs@TOKEN201703241737babcXdefs@$` + 01: TOKEN201703241737{a..b}abc{Z..X}def{s..s}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/ascii-range/010-big-range (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with a big numeric range. + + STDIN: + 01: ./write_all_arguments_on_stdout {A..z} + + STDOUT: + FAILURE expected_to match_regex `^A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@.+@.?@.+@.+@_@.+@a@b@c@d@e@f@g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@$` + 01: {A..z}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/001-simple-ascending-1 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {1..5} + + STDOUT: + FAILURE expected_to match_regex `^1@2@3@4@5@$` + 01: {1..5}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/002-simple-ascending-2 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{1..5}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^TOKEN2017032417371TOKEN201703241737@TOKEN2017032417372TOKEN201703241737@TOKEN2017032417373TOKEN201703241737@TOKEN2017032417374TOKEN201703241737@TOKEN2017032417375TOKEN201703241737@$` + 01: TOKEN201703241737{1..5}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/003-simple-ascending-3 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{1..+5} + + STDOUT: + FAILURE expected_to match_regex `^TOKEN2017032417371@TOKEN2017032417372@TOKEN2017032417373@TOKEN2017032417374@TOKEN2017032417375@$` + 01: TOKEN201703241737{1..+5}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/004-simple-ascending-4 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {-5..0}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^-5TOKEN201703241737@-4TOKEN201703241737@-3TOKEN201703241737@-2TOKEN201703241737@-1TOKEN201703241737@0TOKEN201703241737@$` + 01: {-5..0}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/005-simple-ascending-5 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {-100..-98}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^-100TOKEN201703241737@-99TOKEN201703241737@-98TOKEN201703241737@$` + 01: {-100..-98}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/006-simple-descending-1 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {5..1} + + STDOUT: + FAILURE expected_to match_regex `^5@4@3@2@1@$` + 01: {5..1}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/007-simple-descending-2 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{5..1}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^TOKEN2017032417375TOKEN201703241737@TOKEN2017032417374TOKEN201703241737@TOKEN2017032417373TOKEN201703241737@TOKEN2017032417372TOKEN201703241737@TOKEN2017032417371TOKEN201703241737@$` + 01: TOKEN201703241737{5..1}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/008-simple-descending-3 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{5..+1} + + STDOUT: + FAILURE expected_to match_regex `^TOKEN2017032417375@TOKEN2017032417374@TOKEN2017032417373@TOKEN2017032417372@TOKEN2017032417371@$` + 01: TOKEN201703241737{5..+1}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/009-simple-descending-4 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {0..-5}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^0TOKEN201703241737@-1TOKEN201703241737@-2TOKEN201703241737@-3TOKEN201703241737@-4TOKEN201703241737@-5TOKEN201703241737@$` + 01: {0..-5}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/010-simple-descending-5 (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. + + STDIN: + 01: ./write_all_arguments_on_stdout {-98..-100}TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^-98TOKEN201703241737@-99TOKEN201703241737@-100TOKEN201703241737@$` + 01: {-98..-100}TOKEN201703241737@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/011-identical-positive-start-and-end (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a range of single value. + + STDIN: + 01: ./write_all_arguments_on_stdout {42..42} + + STDOUT: + FAILURE expected_to match_regex `^42@$` + 01: {42..42}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/012-identical-negative-start-and-end (FAILED) + + Description: + The purpose of this test is to check that the brace expansion does work with a range of single value. + + STDIN: + 01: ./write_all_arguments_on_stdout {-42..-42} + + STDOUT: + FAILURE expected_to match_regex `^-42@$` + 01: {-42..-42}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/013-multiple-1 (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. + + STDIN: + 01: ./write_all_arguments_on_stdout {1..2}{3..4}{5..6} + + STDOUT: + FAILURE expected_to match_regex `^135@136@145@146@235@236@245@246@$` + 01: {1..2}{3..4}{5..6}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/014-multiple-2 (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. + + STDIN: + 01: ./write_all_arguments_on_stdout TOKEN201703241737{1..2}abc{-50..-53}def{0..0} + + STDOUT: + FAILURE expected_to match_regex `^TOKEN2017032417371abc-50def0@TOKEN2017032417371abc-51def0@TOKEN2017032417371abc-52def0@TOKEN2017032417371abc-53def0@TOKEN2017032417372abc-50def0@TOKEN2017032417372abc-51def0@TOKEN2017032417372abc-52def0@TOKEN2017032417372abc-53def0@$` + 01: TOKEN201703241737{1..2}abc{-50..-53}def{0..0}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/brace-expansion/numeric-range/015-big-range (FAILED) + + Description: + The purpose of this test is to check that brace expansion may be performed with a big numeric range. + + STDIN: + 01: ./write_all_arguments_on_stdout {-100..100} + + STDOUT: + FAILURE expected_to match_regex `^-100@-99@-98@-97@-96@-95@-94@-93@-92@-91@-90@-89@-88@-87@-86@-85@-84@-83@-82@-81@-80@-79@-78@-77@-76@-75@-74@-73@-72@-71@-70@-69@-68@-67@-66@-65@-64@-63@-62@-61@-60@-59@-58@-57@-56@-55@-54@-53@-52@-51@-50@-49@-48@-47@-46@-45@-44@-43@-42@-41@-40@-39@-38@-37@-36@-35@-34@-33@-32@-31@-30@-29@-28@-27@-26@-25@-24@-23@-22@-21@-20@-19@-18@-17@-16@-15@-14@-13@-12@-11@-10@-9@-8@-7@-6@-5@-4@-3@-2@-1@0@1@2@3@4@5@6@7@8@9@10@11@12@13@14@15@16@17@18@19@20@21@22@23@24@25@26@27@28@29@30@31@32@33@34@35@36@37@38@39@40@41@42@43@44@45@46@47@48@49@50@51@52@53@54@55@56@57@58@59@60@61@62@63@64@65@66@67@68@69@70@71@72@73@74@75@76@77@78@79@80@81@82@83@84@85@86@87@88@89@90@91@92@93@94@95@96@97@98@99@100@$` + 01: {-100..100}@ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/multi/001-range-and-char (FAILED) + + Description: + The purpose of this test is to check that brackets expansion works with a range and 2 characters as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '1' '2' '3' 'a' 'b' 'z' 'C' '-' '[a-z-2]' 'a-z-2' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [a-z-2] + + STDOUT: + FAILURE expected_to match_regex `-@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `z@` + SUCCESS expected_to_not match_regex `1@` + SUCCESS expected_to_not match_regex `3@` + SUCCESS expected_to_not match_regex `C@` + SUCCESS expected_to_not match_regex `[[]a-z-2]@` + SUCCESS expected_to_not match_regex `a-z-2@` + WARNING might match_regex `^-@2@a@b@z@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/multi/002-reverse-range-and-chars (FAILED) + + Description: + The purpose of this test is to check that brackets expansion works with 2 patterns. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a4' 'a3' 'a2' 'a42' 'a[42]' 'z4' 'z3' 'z2' 'z42' 'z[42]' '42' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [!a-y][42] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [^a-y][42] + + STDOUT: + FAILURE expected_to match_regex `42@` + FAILURE expected_to match_regex `z4@` + FAILURE expected_to match_regex `z2@` + SUCCESS expected_to_not match_regex `z3@` + SUCCESS expected_to_not match_regex `z42@` + SUCCESS expected_to_not match_regex `z[[]42]@` + SUCCESS expected_to_not match_regex `a3@` + SUCCESS expected_to_not match_regex `a42@` + SUCCESS expected_to_not match_regex `a[[]42]@` + WARNING might match_regex `^42@z2@z4@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/multi/003-reverse-multi-hard (FAILED) + + Description: + The purpose of this test is to check how the value inside multiple brackets are parsed with bracket as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '][' 'a[' '1[' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [!]az][[] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [^]az][[] + + STDOUT: + FAILURE expected_to match_regex `1[[]@` + SUCCESS expected_to_not match_regex `][[]@` + SUCCESS expected_to_not match_regex `a[[]@` + WARNING might match_regex `^1[[]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range (FAILED) + + Description: + The purpose of this test is to control if 2 patterns splited by a minus characters can be match. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a-0' 'a-1' 'a-2' 'b-0' 'b-1' 'b-2' 'Z-0' 'Z-1' 'Z-2' 'a1' 'Z9' 'D4' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [aZ]-[1-9] + + STDOUT: + FAILURE expected_to match_regex `a-1@` + FAILURE expected_to match_regex `a-2@` + FAILURE expected_to match_regex `Z-1@` + FAILURE expected_to match_regex `Z-2@` + SUCCESS expected_to_not match_regex `a-0@` + SUCCESS expected_to_not match_regex `b-0@` + SUCCESS expected_to_not match_regex `b-1@` + SUCCESS expected_to_not match_regex `b-2@` + SUCCESS expected_to_not match_regex `a1@` + SUCCESS expected_to_not match_regex `Z9@` + SUCCESS expected_to_not match_regex `D4@` + WARNING might match_regex `^Z-1@Z-2@a-1@a-2@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/not/001-simple-opposit-match (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the inversion mark `!` or `^`. The expected behavior is the reversion of the following pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' '1' 'Z' 'd' 'e' 'f' 'def' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [!a1Z] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [^a1Z] + + STDOUT: + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + SUCCESS expected_to_not match_regex `def@` + WARNING might match_regex `^d@e@f@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/not/002-simple-opposite-range (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the inversion mark `!` or `^`. The expected behavior is the reversion of the following pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'z' '1' '2' '3' '42' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [!a-z] + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [^a-z] + + STDOUT: + FAILURE expected_to match_regex `1@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `3@` + SUCCESS expected_to_not match_regex `42@` + WARNING might match_regex `^1@2@3@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/001-alpha-range (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the following pattern `[a-z]`. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'f' 'z' 'A' '1' '[a-z]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [a-z] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `z@` + SUCCESS expected_to_not match_regex `A@` + SUCCESS expected_to_not match_regex `1@` + SUCCESS expected_to_not match_regex `[[]a-z]@` + WARNING might match_regex `^a@f@z@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/002-numeric-range (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the following pattern `[0-9]`. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '4' '2' '1' '9' 'a' 'C' '[0-9]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [0-9] + + STDOUT: + FAILURE expected_to match_regex `1@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `4@` + FAILURE expected_to match_regex `9@` + SUCCESS expected_to_not match_regex `a@` + SUCCESS expected_to_not match_regex `C@` + SUCCESS expected_to_not match_regex `[[]0-9]@` + WARNING might match_regex `^1@2@4@9@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/003-ascii-range-1 (FAILED) + + Description: + The purpose of this test is to check if the bracket expansion works with the following pattern []-z]. + One test use the following range which is the default range for bash: + < > , ; : ! ' " ( ) [ ] { } @ $ \ # % 1 2 3 4 5 6 7 8 9 a A b B c C d D e E f F g G h H i I j J k K l L m M n N o O p P q Q r R s S t T u U v V w W x X y Y z + The other use the ascii value, which does make more sense. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '2' 'a' 'B' 'c' 'Z' '[' ']' '[]-z]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout []-z] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `]@` + SUCCESS expected_to_not match_regex `2@` + SUCCESS expected_to_not match_regex `B@` + SUCCESS expected_to_not match_regex `Z@` + SUCCESS expected_to_not match_regex `[[]@` + SUCCESS expected_to_not match_regex `[[]]-z]@` + WARNING might match_regex `^]@a@c@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2 (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the following pattern `[1-z]`. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '2' 'a' 'B' 'c' 'Z' ']' '[' '[1-z]' '1-z' '-' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [1-z] + + STDOUT: + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `B@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `Z@` + FAILURE expected_to match_regex `]@` + FAILURE expected_to match_regex `[[]@` + SUCCESS expected_to_not match_regex `-@` + SUCCESS expected_to_not match_regex `1-z@` + SUCCESS expected_to_not match_regex `[[]1-z]@` + WARNING might match_regex `^2@B@Z@[[]@]@a@c@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/001-simple-list (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with a simple list of characters as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' '[bca]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [bca] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + SUCCESS expected_to_not match_regex `d@` + SUCCESS expected_to_not match_regex `e@` + SUCCESS expected_to_not match_regex `f@` + SUCCESS expected_to_not match_regex `[[]bca]@` + WARNING might match_regex `^a@b@c@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/002-multi-bracket (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with multiple brackets patterns. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch "TOKEN201703241737abcd" "TOKEN201703241737abc" "TOKEN201703241737abdc" "TOKEN201703241737b" "TOKEN201703241737" "TOKEN201703241737\[a]b\[c]\[d]" + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout TOKEN201703241737[a]b[c][d] + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737abcd@$` + SUCCESS expected_to_not match_regex `TOKEN201703241737abc@` + SUCCESS expected_to_not match_regex `TOKEN201703241737abdc@` + SUCCESS expected_to_not match_regex `TOKEN201703241737b@` + SUCCESS expected_to_not match_regex `TOKEN201703241737@` + SUCCESS expected_to_not match_regex `TOKEN201703241737[[]a]b[[]c][[]d]@` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/003-brackets-as-pattern (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with an opening bracket `[` and a closing bracket `]` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '[' ']' 'a' 'Z' '[][]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [][] + + STDOUT: + FAILURE expected_to match_regex `[[]@` + FAILURE expected_to match_regex `]@` + SUCCESS expected_to_not match_regex `a@` + SUCCESS expected_to_not match_regex `Z@` + SUCCESS expected_to_not match_regex `[[]][[]]@` + WARNING might match_regex `^[[]@]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/004-multi-bracket-multi-char (FAILED) + + Description: + The purpose of this test is to match a file name which contain a bracket as first character. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 21 23 24 25 26 27 28 29 ']' '[' '[12][34]' '1234' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [12][34] + + STDOUT: + FAILURE expected_to match_regex `13@` + FAILURE expected_to match_regex `14@` + FAILURE expected_to match_regex `23@` + FAILURE expected_to match_regex `24@` + SUCCESS expected_to_not match_regex `0[0-9]@` + SUCCESS expected_to_not match_regex `1[0-2]@` + SUCCESS expected_to_not match_regex `1[5-9]@` + SUCCESS expected_to_not match_regex `2[0-2]@` + SUCCESS expected_to_not match_regex `2[5-9]@` + SUCCESS expected_to_not match_regex `[[]@` + SUCCESS expected_to_not match_regex `]@` + SUCCESS expected_to_not match_regex `[[]12][[]34]@` + SUCCESS expected_to_not match_regex `1234@` + WARNING might match_regex `^13@14@23@24@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/single-char-pattern/001-single-char (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with a single character as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' '[a]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [a] + + STDOUT: + FAILURE expected_to match_regex `a@` + SUCCESS expected_to_not match_regex `b@` + SUCCESS expected_to_not match_regex `[[]a]@` + WARNING might match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/single-char-pattern/002-closing-bracket-char (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with a closing bracket `]` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch ']' '[]]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout []] + + STDOUT: + FAILURE expected_to match_regex `]@` + SUCCESS expected_to_not match_regex `[[]]]@` + WARNING might match_regex `^]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/single-char-pattern/003-opening-bracket-char (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with an opening bracket `[` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '[' '[[]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [[] + + STDOUT: + FAILURE expected_to match_regex `[[]@` + SUCCESS expected_to_not match_regex `[[][[]]@` + WARNING might match_regex `^[[]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/local-variable/002-declare-and-expand-2 (FAILED) + + Description: + The purpose of this test is to check that an empty variable is not expanded as an empty string and results in any new argument in the command line. + + STDIN: + 01: TOKEN201703241737_NAME= + 02: ./write_on_stdout_and_stderr $TOKEN201703241737_NAME $TOKEN201703241737_NAME + + STDOUT: + FAILURE expected_to match_regex `write on stdout` + 01:  + + STDERR: + FAILURE expected_to match_regex `write on stderr` + 01:  + +---------------------------------------------------------------- + +42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument (FAILED) + + Description: + The purpose of this test is to check that an unknown variable is not expanded as an empty string and results in any new argument in the command line. + + Before test: + 01: unset "TOKEN201703241737_UNKNOWN" + + STDIN: + 01: ./write_on_stdout $TOKEN201703241737_UNKNOWN TOKEN201703241737_DISPLAYED + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_DISPLAYED` + 01: write on stdout + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/local-variable/004-existing-variable-in-environment-1 (FAILED) + + Description: + The purpose of this test is initialize a local variable named as an environment variable and check if it's update the existing environment variable. + + Before test: + 01: export "TOKEN201703241737_NAME=TOKEN201703241737_VALUE_OLD" + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE_NEW + 02: ./display_env + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE_NEW$` + FAILURE expected_to_not match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE_OLD$` + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TOKEN201703241737_NAME=TOKEN201703241737_VALUE_OLD + 04: TERM=screen-256color + 05: SHELL=/bin/zsh + 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 09: TERM_PROGRAM_VERSION=3.0.10 + 10: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 11: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 12: ZSH=/Users/ariard/.oh-my-zsh + 13: USER=ariard + 14: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 15: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 16: PAGER=less + 17: TMUX=/private/tmp/tmux-18965/default,73780,2 + 18: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 19: LSCOLORS=Gxfxcxdxbxegedabagacad + 20: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 21: MAIL=ariard@student.42.fr + 22: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 23: LANG=en_US.UTF-8 + 24: ITERM_PROFILE=Default + 25: XPC_FLAGS=0x0 + 26: TMUX_PANE=%9 + 27: XPC_SERVICE_NAME=0 + 28: SHLVL=4 + 29: HOME=/Users/ariard + 30: COLORFGBG=7;0 + 31: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 32: LOGNAME=ariard + 33: LESS=-R + 34: LC_CTYPE=en_US.UTF-8 + 35: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 36: _=../../42sh + 37: ?=0 + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 36 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/local-variable/005-existing-variable-in-environment-2 (FAILED) + + Description: + The purpose of this test is initialize a local variable named as an environment variable and check if it's update the existing environment variable. + + Before test: + 01: export "TOKEN201703241737_NAME=TOKEN201703241737_VALUE" + + STDIN: + 01: TOKEN201703241737_NAME= + 02: ./display_env + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=$` + FAILURE expected_to_not match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE$` + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + 04: TERM=screen-256color + 05: SHELL=/bin/zsh + 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 09: TERM_PROGRAM_VERSION=3.0.10 + 10: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 11: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 12: ZSH=/Users/ariard/.oh-my-zsh + 13: USER=ariard + 14: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 15: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 16: PAGER=less + 17: TMUX=/private/tmp/tmux-18965/default,73780,2 + 18: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 19: LSCOLORS=Gxfxcxdxbxegedabagacad + 20: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 21: MAIL=ariard@student.42.fr + 22: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 23: LANG=en_US.UTF-8 + 24: ITERM_PROFILE=Default + 25: XPC_FLAGS=0x0 + 26: TMUX_PANE=%9 + 27: XPC_SERVICE_NAME=0 + 28: SHLVL=4 + 29: HOME=/Users/ariard + 30: COLORFGBG=7;0 + 31: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 32: LOGNAME=ariard + 33: LESS=-R + 34: LC_CTYPE=en_US.UTF-8 + 35: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 36: _=../../42sh + 37: ?=0 + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 36 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/local-variable/007-multiple-declaration-at-a-time (FAILED) + + Description: + The purpose of this test is to check that declaring multiple variables in the same command line does work. + + STDIN: + 01: TOKEN201703241737_NAME1=TOKEN201703241737_VALUE1 TOKEN201703241737_NAME2=TOKEN201703241737_VALUE2 TOKEN201703241737_NAME3=TOKEN201703241737_VALUE3 + 02: ./write_on_stdout_and_stderr $TOKEN201703241737_NAME1 $TOKEN201703241737_NAME1 + 03: ./write_on_stdout $TOKEN201703241737_NAME2 + 04: ./write_on_stderr $TOKEN201703241737_NAME3 + + STDOUT: + SUCCESS expected_to match_regex `^TOKEN201703241737_VALUE1$` + FAILURE expected_to match_regex `^TOKEN201703241737_VALUE2$` + SUCCESS expected_to_not match_regex `^TOKEN201703241737_VALUE3$` + 01: TOKEN201703241737_VALUE1 + 02:  + + STDERR: + SUCCESS expected_to match_regex `^TOKEN201703241737_VALUE1$` + SUCCESS expected_to_not match_regex `^TOKEN201703241737_VALUE2$` + FAILURE expected_to match_regex `^TOKEN201703241737_VALUE3$` + 01: TOKEN201703241737_VALUE1 + 02:  + +---------------------------------------------------------------- + +42sh/local-variable/008-multiple-declaration-with-same-name (FAILED) + + Description: + The purpose of this test is to check that declaring the same variable several times in the same command line does work and does not result in error. + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE1 TOKEN201703241737_NAME=TOKEN201703241737_VALUE2 TOKEN201703241737_NAME=TOKEN201703241737_VALUE3 + 02: ./write_on_stdout $TOKEN201703241737_NAME + + STDOUT: + FAILURE expected_to_not match_regex `^TOKEN201703241737_VALUE1$` + SUCCESS expected_to_not match_regex `^TOKEN201703241737_VALUE2$` + FAILURE expected_to match_regex `^TOKEN201703241737_VALUE3$` + 01: TOKEN201703241737_VALUE1 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/local-variable/mixed/inline-environment-variable/001-local-variable-shouldnt-be-set (FAILED) + + Description: + The purpose of this test is to check that declaring a variable and specifying a binary does not result in local variable declaration but a modified environment for the command. + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_VALUE ./display_env + 02: ./write_on_stderr $TOKEN201703241737 + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE$` + (no output) + + STDERR: + FAILURE expected_to_not match_regex `TOKEN201703241737_VALUE` + FAILURE expected_to match_regex `write on stderr` + 01: ../../42sh: command not found: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + 02:  + +---------------------------------------------------------------- + +42sh/local-variable/mixed/redirections/001-truncating (FAILED) + + Description: + The purpose of this test is to check that a redirection can be set with a local variable as file name. + + Before test: + 01: rm -f "TOKEN201703241737_FILENAME" + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_FILENAME + 02: ./write_on_stdout TOKEN201703241737_VALUE > $TOKEN201703241737_NAME + + STDOUT: + SUCCESS expected_to be_empty + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + FAILURE expected_to create_file `TOKEN201703241737_FILENAME` matching_regex `^TOKEN201703241737_VALUE$` + SUCCESS expected_to exit_with_status `0` + +---------------------------------------------------------------- + +42sh/local-variable/mixed/redirections/002-appending (FAILED) + + Description: + The purpose of this test is to check that a redirection can be set with a local variable as file name. + + Before test: + 01: rm -f "TOKEN201703241737_FILENAME" + + STDIN: + 01: TOKEN201703241737_NAME=TOKEN201703241737_FILENAME + 02: ./write_on_stdout TOKEN201703241737_VALUE1 >> $TOKEN201703241737_NAME + 03: ./write_on_stdout TOKEN201703241737_VALUE2 >> $TOKEN201703241737_NAME + + STDOUT: + SUCCESS expected_to be_empty + (no output) + + STDERR: + SUCCESS expected_to be_empty + (no output) + + MISC: + FAILURE expected_to create_file `TOKEN201703241737_FILENAME` matching_regex `^TOKEN201703241737_VALUE1$` + FAILURE expected_to create_file `TOKEN201703241737_FILENAME` matching_regex `^TOKEN201703241737_VALUE2$` + SUCCESS expected_to exit_with_status `0` + +---------------------------------------------------------------- + +42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion (FAILED) + + Description: + The purpose of this test is to check that the tilde expansion `~` in variable declaration. + + Before test: + 01: export "HOME=/TOKEN201703241737" + + STDIN: + 01: TOKEN201703241737=~ + 02: ./write_on_stdout TILDE:$TOKEN201703241737 + + STDOUT: + FAILURE expected_to_not match_regex `TILDE:~` + WARNING might match_regex `TILDE:/TOKEN201703241737` + 01: TILDE:~ + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/escaping/002-escape-double-quote-2 (FAILED) + + Description: + The purpose of this test is to check that a double-quote `"` may be preserved when it is preceded by a backslash `\\`. + + STDIN: + 01: ./write_on_stdout "TOKEN201703241737 \" TOKEN201703241737" + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737 ` TOKEN201703241737$` + 01: TOKEN201703241737 TOKEN201703241737 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/escaping/003-escape-double-quote-3 (FAILED) + + Description: + The purpose of this test is to check that a double-quote `"` may be preserved when it is preceded by a backslash `\\`. + + STDIN: + 01: ./write_on_stdout "\"" + + STDOUT: + FAILURE expected_to match_regex `^"$` + 01:  + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/escaping/004-it-results-in-error (FAILED) + + Description: + The purpose of this test is to check that using backslash `\\` before the closing double-quote `"` does result in syntax error. + + STDIN: + 01: ./write_on_stdout "TOKEN201703241737\" + + STDOUT: + SUCCESS expected_to_not match_regex `^TOKEN201703241737$` + (no output) + + STDERR: + FAILURE expected_to_not be_empty + WARNING might match_regex `([Ss]yntax|[Pp]arse) error` + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/escaping/005-it-does-not-escape-double-quote (FAILED) + + Description: + The purpose of this test is to check that using two backslashes `\\` before the symbol double-quote `"` does not result in escaped inhibitors. + + STDIN: + 01: ./write_on_stdout \\"TOKEN201703241737\\" + + STDOUT: + FAILURE expected_to match_regex `^\TOKEN201703241737\$` + 01: \TOKEN201703241737 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout {1..2}"{1..2}" + + STDOUT: + FAILURE expected_to match_regex `1[{]1..2}@2[{]1..2}@` + 01: {1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout "{1..2}"{1..2} + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}1@[{]1..2}2@` + 01: {1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/brace-expansion/004-it-does-not-expand-braces-4 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout "{1..2}"{1..2}"{1..2}"{1..2}"{1..2}"{1..2} + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}1[{]1..2}1[{]1..2}1@[{]1..2}1[{]1..2}1[{]1..2}2@[{]1..2}1[{]1..2}2[{]1..2}1@[{]1..2}1[{]1..2}2[{]1..2}2@[{]1..2}2[{]1..2}1[{]1..2}1@[{]1..2}2[{]1..2}1[{]1..2}2@[{]1..2}2[{]1..2}2[{]1..2}1@[{]1..2}2[{]1..2}2[{]1..2}2@` + 01: {1..2}{1..2}{1..2}{1..2}{1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout "{1..2}" {1..2} "{1..2}" "{1..2}" + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}@1@2@[{]1..2}@[{]1..2}@` + 01: {1..2}@{1..2}@{1..2}@{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout ["a"] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout ["a"bc"def"gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout "{1..2}"{1..2}'{1..2}'{1..2}"{1..2}"{1..2} + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}1[{]1..2}1[{]1..2}1@[{]1..2}1[{]1..2}1[{]1..2}2@[{]1..2}1[{]1..2}2[{]1..2}1@[{]1..2}1[{]1..2}2[{]1..2}2@[{]1..2}2[{]1..2}1[{]1..2}1@[{]1..2}2[{]1..2}1[{]1..2}2@[{]1..2}2[{]1..2}2[{]1..2}1@[{]1..2}2[{]1..2}2[{]1..2}2@` + 01: {1..2}{1..2}{1..2}{1..2}{1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout [""'a'""] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout ["a"bc'def'gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes (FAILED) + + Description: + The purpose of this test is to check if a local variable is display correctly inside simple and double quote. + + Before test: + 01: export "TOKEN201703241737_NAME=TOKEN201703241737_VALUE" + + STDIN: + 01: ./write_on_stdout "$TOKEN201703241737_NAME"$TOKEN201703241737_NAME'$TOKEN201703241737_NAME' + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241737_VALUETOKEN201703241737_VALUE[$]TOKEN201703241737_NAME` + 01: TOKEN201703241737_VALUEE$TOKEN201703241737_NAME + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout {1..2}'{1..2}' + + STDOUT: + FAILURE expected_to match_regex `1[{]1..2}@2[{]1..2}@` + 01: {1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout '{1..2}'{1..2} + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}1@[{]1..2}2@` + 01: {1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/004-it-does-not-expand-braces-4 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout '{1..2}'{1..2}'{1..2}'{1..2}'{1..2}'{1..2} + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}1[{]1..2}1[{]1..2}1@[{]1..2}1[{]1..2}1[{]1..2}2@[{]1..2}1[{]1..2}2[{]1..2}1@[{]1..2}1[{]1..2}2[{]1..2}2@[{]1..2}2[{]1..2}1[{]1..2}1@[{]1..2}2[{]1..2}1[{]1..2}2@[{]1..2}2[{]1..2}2[{]1..2}1@[{]1..2}2[{]1..2}2[{]1..2}2@` + 01: {1..2}{1..2}{1..2}{1..2}{1..2}{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5 (FAILED) + + Description: + The purpose of this test is to check that braces expansion is not processed within quoted part of the command line. + + STDIN: + 01: ./write_all_arguments_on_stdout '{1..2}' {1..2} '{1..2}' '{1..2}' + + STDOUT: + FAILURE expected_to match_regex `[{]1..2}@1@2@[{]1..2}@[{]1..2}@` + 01: {1..2}@{1..2}@{1..2}@{1..2}@ + + STDERR: + (no output) + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout ['a'] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42ShellTester/tmp/write_all_arguments_on_stdout ['a'bc'def'gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/subshell/mixed/inline-environment-variable/001-modifies-the-child-environment-only-1 (FAILED) + + Description: + The purpose of this test is to check that declaring a variable and specifying a binary in a subshell does not result in local variable declaration or a modified parent shell's environment, but only a modified child's environment. + + STDIN: + 01: (TOKEN201703241737_NAME=TOKEN201703241737_VALUE ./display_env) + 02: ./display_env + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE$` once + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TERM=screen-256color + 04: SHELL=/bin/zsh + 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 10: ZSH=/Users/ariard/.oh-my-zsh + 11: USER=ariard + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 14: PAGER=less + 15: TMUX=/private/tmp/tmux-18965/default,73780,2 + 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 17: LSCOLORS=Gxfxcxdxbxegedabagacad + 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 19: MAIL=ariard@student.42.fr + 20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 21: LANG=en_US.UTF-8 + 22: ITERM_PROFILE=Default + 23: XPC_FLAGS=0x0 + 24: TMUX_PANE=%9 + 25: XPC_SERVICE_NAME=0 + 26: SHLVL=4 + 27: HOME=/Users/ariard + 28: COLORFGBG=7;0 + 29: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 30: LOGNAME=ariard + 31: LESS=-R + 32: LC_CTYPE=en_US.UTF-8 + 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 35: _=../../42sh + 36: ?=127 + 37: ------------------------------ + 38: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: command not found: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + +---------------------------------------------------------------- + +42sh/subshell/mixed/inline-environment-variable/002-modifies-the-child-environment-only-2 (FAILED) + + Description: + The purpose of this test is to check that declaring a variable and specifying a binary in a subshell does not result in local variable declaration or a modified parent shell's environment, but only a modified child's environment. + + STDIN: + 01: ( (TOKEN201703241737_NAME=TOKEN201703241737_VALUE ./display_env) ; ./display_env) ; ./display_env + 02:  + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703241737_NAME=TOKEN201703241737_VALUE$` once + 01: ------------------------------ + 02: TERM_PROGRAM=iTerm.app + 03: TERM=screen-256color + 04: SHELL=/bin/zsh + 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 10: ZSH=/Users/ariard/.oh-my-zsh + 11: USER=ariard + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 14: PAGER=less + 15: TMUX=/private/tmp/tmux-18965/default,73780,2 + 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 17: LSCOLORS=Gxfxcxdxbxegedabagacad + 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 19: MAIL=ariard@student.42.fr + 20: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 21: LANG=en_US.UTF-8 + 22: ITERM_PROFILE=Default + 23: XPC_FLAGS=0x0 + 24: TMUX_PANE=%9 + 25: XPC_SERVICE_NAME=0 + 26: SHLVL=4 + 27: HOME=/Users/ariard + 28: COLORFGBG=7;0 + 29: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 30: LOGNAME=ariard + 31: LESS=-R + 32: LC_CTYPE=en_US.UTF-8 + 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 34: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 35: _=../../42sh + 36: ?=127 + 37: ------------------------------ + 38: TOTAL ENVIRONMENT VARIABLES: 35 + 39: ------------------------------ + 40: TERM_PROGRAM=iTerm.app + 41: TERM=screen-256color + 42: SHELL=/bin/zsh + 43: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 44: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 45: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 46: TERM_PROGRAM_VERSION=3.0.10 + 47: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 48: ZSH=/Users/ariard/.oh-my-zsh + 49: USER=ariard + 50: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 51: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 52: PAGER=less + 53: TMUX=/private/tmp/tmux-18965/default,73780,2 + 54: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 55: LSCOLORS=Gxfxcxdxbxegedabagacad + 56: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 57: MAIL=ariard@student.42.fr + 58: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 59: LANG=en_US.UTF-8 + 60: ITERM_PROFILE=Default + 61: XPC_FLAGS=0x0 + 62: TMUX_PANE=%9 + 63: XPC_SERVICE_NAME=0 + 64: SHLVL=4 + 65: HOME=/Users/ariard + 66: COLORFGBG=7;0 + 67: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 68: LOGNAME=ariard + 69: LESS=-R + 70: LC_CTYPE=en_US.UTF-8 + 71: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 72: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester + 73: _=../../42sh + 74: ?=0 + 75: ------------------------------ + 76: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: command not found: TOKEN201703241737_NAME=TOKEN201703241737_VALUE + +Total tests: 162 +Total failed tests: 92 +Total pending tests: 0 diff --git a/42sh/42shelltest-tmp/log b/42sh/42shelltest-tmp/log deleted file mode 100644 index b53a5886..00000000 --- a/42sh/42shelltest-tmp/log +++ /dev/null @@ -1 +0,0 @@ -xxxx.x \ No newline at end of file diff --git a/42sh/42shelltest-tmp/log1 b/42sh/42shelltest-tmp/log1 deleted file mode 100644 index 1021b813..00000000 --- a/42sh/42shelltest-tmp/log1 +++ /dev/null @@ -1,933 +0,0 @@ -...xxxxxxxxxxxxxxxxxxx~xxxxxxxxx..xxxxx..xxx....x....x - ----------------------------------------------------------------- - -minishell/binary/004-binary-test-empty-path (FAILED) - - Description: - The purpose of this test is to check that the Shell finds binaries that are located in the current directory when the environment variable PATH is empty. - - Before test: - 01: export PATH="" - - STDIN: - 01: write_on_stdout "TOKEN201703202355" - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703202355` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: minishell: command not found: write_on_stdout - - MISC: - SUCCESS expected_to exit_with_status `0` - ----------------------------------------------------------------- - -minishell/binary/005-binary-test-wrong-path (FAILED) - - Description: - This test purpose is to check if your shell is not able to use binary with a wrong PATH - We are changing the actual PATH by PATH=NULL - And executing the commande ls - - Before test: - 01: export PATH="/" - - STDIN: - 01: ls - - STDOUT: - SUCCESS might be_empty - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - SUCCESS might match_regex `[Cc]ommand not found` - 01: minishell: command not found: ls - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/binary/006-binary-undefined-path (FAILED) - - Description: - The purpose of this test is to check that the Shell retrieves the default value of the environment variable PATH if not set. This test depends on the presence of the UNIX binary `ls`, located in a path within the default environment variable PATH. - - Before test: - 01: rm -rf "TOKEN201703202355_006-BINARY-UNDEFINED-PATH" - 02: touch "TOKEN201703202355_006-BINARY-UNDEFINED-PATH" - 03: unset PATH - - STDIN: - 01: ls - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703202355_006-BINARY-UNDEFINED-PATH` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: minishell: command not found: ls - - MISC: - SUCCESS expected_to exit_with_status `0` - ----------------------------------------------------------------- - -minishell/binary/007-binary-permission-denied (FAILED) - - Description: - The purpose of this test is to check that trying to execute a non-permitted binary results in an error on standard error and a failure exit status. - - Before test: - 01: rm -rf ./permission_denied - 02: touch ./permission_denied - 03: chmod 0 ./permission_denied - - STDIN: - 01: ./permission_denied - - STDOUT: - SUCCESS might be_empty - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - SUCCESS might match_regex `[Pp]ermission denied` - 01: minishell: permission denied: ./permission_denied - - MISC: - FAILURE expected_to_not exit_with_status 0 - - After test: - 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi - 02: rm -rf "./permission_denied" - ----------------------------------------------------------------- - -minishell/binary/008-binary-too-many-symbolic-links-encountered (FAILED) - - Description: - The purpose of this test is to check that trying to execute a path that encounters an infinite loop of symbolic link results in an error on standard error and a failure exit status. - - Before test: - 01: rm -rf ./symbolic_link1 ./symbolic_link2 ./symbolic_link3 - 02: ln -s ./symbolic_link1 ./symbolic_link2 - 03: ln -s ./symbolic_link2 ./symbolic_link3 - 04: ln -s ./symbolic_link3 ./symbolic_link1 - - STDIN: - 01: ./symbolic_link1 - - STDOUT: - SUCCESS might be_empty - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `[Tt]oo many.*symbolic links` - 01: minishell: ./symbolic_link1: no such file or directory - - MISC: - FAILURE expected_to_not exit_with_status 0 - ----------------------------------------------------------------- - -minishell/builtins/cd/001-no-arg (FAILED) - - Description: - The purpose of this test is to check that using the builtin `cd` without any argument results in moving to the HOME directory. - - STDIN: - 01: cd - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - SUCCESS expected_to_not match_regex `/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` - FAILURE expected_to match_regex `PWD:/Users/ariard:PWD` - 01: /Users/ariard - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/002-current-directory (FAILED) - - Description: - The purpose of this test is to check that using `.` as first argument with the builtin `cd` results in not changing current directory. - - STDIN: - 01: cd . - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/003-current-directory-2 (FAILED) - - Description: - The purpose of this test is to check that using a relative path to the current directory as argument with the builtin `cd` results in not changing the current directory. The environment variable must not be changed. - - STDIN: - 01: cd ../tmp - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/004-parent-directory (FAILED) - - Description: - The purpose of this test is to check that using `..` as first argument with the builtin `cd` results in moving to the parent directory. - - STDIN: - 01: cd .. - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp:PWD$` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/005-root-path (FAILED) - - Description: - The purpose of this test is to check that using the root path as first argument with the builtin `cd` results in moving to the correct directory. - - STDIN: - 01: cd / - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/:PWD` - FAILURE expected_to match_regex `^PWD=/$` - 01: PWD:/:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/006-root-path-2 (FAILED) - - Description: - The purpose of this test is to check that using the root path as first argument with the builtin `cd` results in moving to the correct directory. - - STDIN: - 01: cd /. - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/:PWD` - FAILURE expected_to match_regex `^PWD=/$` - 01: PWD:/:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/007-symbolic-link (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving the linked directory. - - Before test: - 01: rm -f "./symbolic_link" - 02: mkdir -p "./sub_directory" - 03: ln -s "./sub_directory" "./symbolic_link" - - STDIN: - 01: cd symbolic_link - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD$` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/symbolic_link$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/008-symbolic-link-2 (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving to the linked directory. In this test, the directory is linked with to chained symbolic links. - - Before test: - 01: rm -f "./symbolic_link1" "./symbolic_link2" - 02: mkdir -p "./sub_directory" - 03: ln -s "./sub_directory" "./symbolic_link1" - 04: ln -s "./symbolic_link1" "./symbolic_link2" - - STDIN: - 01: cd symbolic_link2 - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD$` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/symbolic_link2$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/010-update-OLDPWD (FAILED) - - Description: - The purpose of this test is to check that using the builtin `cd` results in a modified environment variable `PWD`. - - Before test: - 01: rm -rf "TOKEN201703202355" - 02: mkdir -p "./TOKEN201703202355/TOKEN201703202355" - - STDIN: - 01: cd TOKEN201703202355 - 02: cd TOKEN201703202355 - 03: ../../display_env - - STDOUT: - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/TOKEN201703202355/TOKEN201703202355$` - FAILURE expected_to match_regex `^OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/TOKEN201703202355$` - (no output) - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/011-dotdot (FAILED) - - Description: - The purpose of this test is to check that playing with relative paths with the builtin `cd` results in correctly changing the current directory. - - Before test: - 01: rm -rf "playing_with_dotdot" - 02: mkdir -p "playing_with_dotdot/1/2/3/4/5/6/7/8/9/10" - - STDIN: - 01: cd playing_with_dotdot - 02: cd ../playing_with_dotdot - 03: cd 1/2/3/4/../4/../4/../../3/4/5/6/7/8/9/10 - 04: cd ../../../../../../../../../../1/2/3/4/5 - 05: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 06: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/playing_with_dotdot/1/2/3/4/5:PWD` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/playing_with_dotdot/1/2/3/4/5$` - (no output) - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/012-dot (FAILED) - - Description: - The purpose of this test is to check that playing with relative paths to the current directory with the builtin `cd` results in not changing the current directory. - - STDIN: - 01: cd . - 02: cd ./ - 03: cd ./. - 04: cd ././ - 05: cd ./././././././././. - 06: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 07: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/013-absolute-path (FAILED) - - Description: - The purpose of this test is to check that using an absolute path as first argument with the builtin `cd` results in moving to the correct directory. - - Before test: - 01: rm -rf "./my_sub_directory" - 02: mkdir -p "./my_sub_directory/and_another_one/" - - STDIN: - 01: cd /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/my_sub_directory/and_another_one - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/my_sub_directory/and_another_one:PWD` - FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/my_sub_directory/and_another_one$` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/my_sub_directory/and_another_one:PWD - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/001-not-a-directory (FAILED) - - Description: - The purpose of this test is to check that using a file name as first argument with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: touch "./not_a_directory" - - STDIN: - 01: cd not_a_directory - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `[Nn]ot a directory` - 01: cd: no such file or directory: not_a_directory - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/002-not-a-directory-2 (FAILED) - - Description: - The purpose of this test is to check that using a file name as first argument with the builtin `cd` results in a Shell termination with a failure exit status. - - Before test: - 01: touch "./not_a_directory" - - STDIN: - 01: cd not_a_directory - - STDOUT: - (no output) - - STDERR: - 01: cd: no such file or directory: not_a_directory - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/003-permission-denied (WARNING) - - Description: - The purpose of this test is to check that using a directory without any permission as first argument with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi - 02: rm -rf "./permission_denied" - 03: mkdir -m 0 "./permission_denied" - - STDIN: - 01: cd permission_denied - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `[Pp]ermission denied` - 01: cd: no such file or directory: permission_denied - - After test: - 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi - 02: rm -rf "./permission_denied" - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/004-permission-denied-2 (FAILED) - - Description: - The purpose of this test is to check that using a directory without any permission as first argument with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi - 02: rm -rf "./permission_denied" - 03: mkdir -m 0 "./permission_denied" - - STDIN: - 01: cd permission_denied - - STDOUT: - (no output) - - STDERR: - 01: cd: no such file or directory: permission_denied - - MISC: - FAILURE expected_to_not exit_with_status `0` - - After test: - 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi - 02: rm -rf "./permission_denied" - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link resulting in ELOOP error as first argument with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: rm -f "./symbolic_link1" "./symbolic_link2" "./symbolic_link3" - 02: ln -s "./symbolic_link1" "./symbolic_link2" - 03: ln -s "./symbolic_link2" "./symbolic_link3" - 04: ln -s "./symbolic_link3" "./symbolic_link1" - - STDIN: - 01: cd symbolic_link1 - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `[Tt]oo many.*symbolic links` - 01: cd: no such file or directory: symbolic_link1 - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/006-too-many-symbolic-links-encountered-2 (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link resulting in ELOOP error as first argument with the builtin `cd` results in a Shell termination with a failure exit status. - - Before test: - 01: rm -f "./symbolic_link1" "./symbolic_link2" "./symbolic_link3" - 02: ln -s "./symbolic_link1" "./symbolic_link2" - 03: ln -s "./symbolic_link2" "./symbolic_link3" - 04: ln -s "./symbolic_link3" "./symbolic_link1" - - STDIN: - 01: cd symbolic_link1 - - STDOUT: - (no output) - - STDERR: - 01: cd: no such file or directory: symbolic_link1 - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/007-no-such-file-or-directory (FAILED) - - Description: - The purpose of this test is to check that using a non-existing path as first argument with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: rm -f "./no_such_file_or_directory" - - STDIN: - 01: cd no_such_file_or_directory - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - SUCCESS might match_regex `[Nn]o such file or directory` - 01: cd: no such file or directory: no_such_file_or_directory - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/008-no-such-file-or-directory-2 (FAILED) - - Description: - The purpose of this test is to check that using a non-existing path as first argument with the builtin `cd` results in a Shell termination with an error status code. - - Before test: - 01: rm -f "./no_such_file_or_directory" - - STDIN: - 01: cd no_such_file_or_directory - - STDOUT: - (no output) - - STDERR: - 01: cd: no such file or directory: no_such_file_or_directory - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/009-no-such-file-or-directory-symlink (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link that targets to a non-existing directory with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: rm -rf "./enoent_symlink" "./enoent_directory" - 02: ln -s "./enoent_directory" "./enoent_symlink" - - STDIN: - 01: cd ./enoent_symlink - 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - SUCCESS might match_regex `[Nn]o such file or directory` - 01: cd: no such file or directory: ./enoent_symlink - ----------------------------------------------------------------- - -minishell/builtins/cd/errors/010-no-such-file-or-directory-symlink-2 (FAILED) - - Description: - The purpose of this test is to check that using a symbolic link that targets to a non-existing directory with the builtin `cd` results in error and not changing current directory. - - Before test: - 01: rm -rf "./enoent_symlink" "./enoent_directory" - 02: ln -s "./enoent_directory" "./enoent_symlink" - - STDIN: - 01: cd ./enoent_symlink - - STDOUT: - (no output) - - STDERR: - 01: cd: no such file or directory: ./enoent_symlink - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/cd/options/001-not-following-links (FAILED) - - Description: - The purpose of this test is to check that using symbolic links twice with the builtin `cd` and the option `-P` results in a correct environment variable PWD. The option `-P` makes the Shell to resolve symbolic links. - - Before test: - 01: rm -fr "./sub_directory_link" "./sub_directory" - 02: mkdir -p "./sub_directory/sub_sub_directory" - 03: ln -s "./sub_directory" "./sub_directory_link" - 04: ln -s "./sub_sub_directory" "./sub_directory/sub_sub_directory_link" - - STDIN: - 01: cd -P sub_directory_link - 02: cd -P sub_sub_directory_link - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env - - STDOUT: - FAILURE expected_to match_regex `PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory/sub_sub_directory` - (no output) - - STDERR: - SUCCESS might be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/cd/options/002-oldpwd (FAILED) - - Description: - The purpose of this test is to check that using `-` as first argument with the builtin `cd` results in moving the previous current directory. - - STDIN: - 01: cd / - 02: cd - - 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` - 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/env/003-ignore-environment (FAILED) - - Description: - The purpose of this test is to check that using the option `-i` with the builtin `env` results in an empty environment sent to the given command. - - STDIN: - 01: env -i ./display_env - - STDOUT: - FAILURE expected_to match_regex `TOTAL ENVIRONMENT VARIABLES: 0` - (no output) - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/env/005-set-variables (FAILED) - - Description: - The purpose of this test is to check that the builtin `env` can modify or set multiple environment variables before executing the given command. - - Before test: - 01: export VARTEST1="OLD_VALUE" - - STDIN: - 01: env VARTEST1=TOKEN201703202355_1 VARTEST2=TOKEN201703202355_2 VARTEST3=TOKEN201703202355_3 ./display_env - - STDOUT: - FAILURE expected_to match_regex `VARTEST1=TOKEN201703202355_1` - FAILURE expected_to match_regex `VARTEST2=TOKEN201703202355_2` - FAILURE expected_to match_regex `VARTEST3=TOKEN201703202355_3` - (no output) - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/env/errors/001-command-not-found (FAILED) - - Description: - The purpose of this test is to check that using the builtin `env` with an invalid binary as argument results in an error and failure exit status. - - Before test: - 01: rm -f "./invalid_binary" - - STDIN: - 01: env ./invalid_binary - - STDOUT: - (no output) - - STDERR: - FAILURE expected_to_not be_empty - WARNING might match_regex `[Cc]ommand not found` - (no output) - - MISC: - SUCCESS expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/env/errors/002-illegal-option (FAILED) - - Description: - The purpose of this test is to check that using the builtin `env` with an invalid option results in an error and failure exit status. - - Before test: - 01: rm -f -- "-w" - - STDIN: - 01: env -w - - STDOUT: - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - SUCCESS might match_regex `([Ii]nvalid|[Ii]llegal) (option|argument)` - 01: env: illegal option -- w - 02: usage: env [-i] [-u name] [name=value]... [utility [argument...]] - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/env/multiple-options/001-ignore-environment-and-set-variable (FAILED) - - Description: - The purpose of this test is to check that `env -i` works if we use a second argument to set an environment variable, we are also checking if this command unset environments variables for a given binary. - - STDIN: - 01: env -i TESTVARIABLE=TOKEN201703202355 ./display_env - - STDOUT: - FAILURE expected_to match_regex `TESTVARIABLE=TOKEN201703202355` - FAILURE expected_to match_regex `TOTAL ENVIRONMENT VARIABLES: 1` - (no output) - - STDERR: - SUCCESS expected_to be_empty - (no output) - ----------------------------------------------------------------- - -minishell/builtins/exit/003-status-of-last-command (FAILED) - - Description: - The purpose of this test is to check that using the builtin `exit` without any argument results in a Shell termination and the exit status of the previous command. - - STDIN: - 01: ./exit_with_status 42 - 02: exit - - STDOUT: - SUCCESS might be_empty - (no output) - - STDERR: - (no output) - - MISC: - FAILURE expected_to exit_with_status `42` - ----------------------------------------------------------------- - -minishell/builtins/exit/errors/001-too-many-args (FAILED) - - Description: - The purpose of this test is to check that using a wrong number of arguments with the builtin `exit` does not result in the Shell termination but an error on standard error. - - STDIN: - 01: exit 21 42 - 02: ./write_on_stdout TOKEN201703202355 - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703202355` - (no output) - - STDERR: - FAILURE expected_to_not be_empty - WARNING might match_regex `([Tt]oo many arguments|[Aa]rgument list too long)` - (no output) - - MISC: - FAILURE expected_to exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/exit/errors/002-non-numeric-argument (FAILED) - - Description: - The purpose of this test is to check that using a non-numeric argument with the builtin `exit` results in the Shell termination and an error on standard error. - - STDIN: - 01: exit abc - 02: ./write_on_stdout TOKEN201703202355 - - STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703202355` - (no output) - - STDERR: - WARNING might_not be_empty - WARNING might match_regex `[Nn]umeric argument required` - (no output) - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/setenv/004-invalid-identifier (FAILED) - - Description: - The purpose of this test is to check that using a wrong variable name with the builtin `setenv` (or `export`) results in error. - - STDIN: - 01: setenv 42 - 02: export 42 - - STDOUT: - SUCCESS might be_empty - (no output) - - STDERR: - FAILURE expected_to_not be_empty - WARNING might match_regex `(not.*identifier|must begin.*letter)` - (no output) - ----------------------------------------------------------------- - -minishell/misc/001-copy-of-environment (FAILED) - - Description: - A Shell must send a copy of the environment to its child processes. - - Before test: - 01: export COPYENV_VAR1="TOKEN201703202355_VAR1" - 02: export COPYENV_VAR2="TOKEN201703202355_VAR2" - 03: export COPYENV_VAR3="TOKEN201703202355_VAR3" - - STDIN: - 01: ./display_env - - STDOUT: - FAILURE expected_to match_regex `COPYENV_VAR1=TOKEN201703202355_VAR1` - FAILURE expected_to match_regex `COPYENV_VAR2=TOKEN201703202355_VAR2` - FAILURE expected_to match_regex `COPYENV_VAR3=TOKEN201703202355_VAR3` - (no output) - - STDERR: - (no output) - -Total tests: 54 -Total failed tests: 38 -Total pending tests: 0 diff --git a/42sh/42shelltest-tmp/spec/bonuses/README.md b/42sh/42shelltest-tmp/spec/bonuses/README.md deleted file mode 100644 index 9c789434..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# bonuses - -*[spec](..) > bonuses* - -* [builtins](./builtins) -* [inline-environment-variable](./inline-environment-variable) -* [redirections](./redirections) -* [separators](./separators) -* [tilde-expansion](./tilde-expansion) diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/README.md b/42sh/42shelltest-tmp/spec/bonuses/builtins/README.md deleted file mode 100644 index bc79927e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# builtins - -*[spec > bonuses](..) > builtins* - -* [env](./env) diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/README.md b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/README.md deleted file mode 100644 index 3a763d0a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# 001-unset-variables - -*[spec > bonuses > builtins > env](..) > 001-unset-variables* - -The purpose of this test is to check that the builtin `env` implement the option `-u` to unset environment variables. -### What is done before test - -```bash -export TESTVARIABLE="${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -env -u HOME -u PATH -u TESTVARIABLE ./display_env - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "HOME=" -expected_to_not match_regex "PATH=" -expected_to_not match_regex "TESTVARIABLE=" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/before_exec b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/before_exec deleted file mode 100644 index b5017f3b..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/before_exec +++ /dev/null @@ -1 +0,0 @@ -export TESTVARIABLE="${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/description b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/description deleted file mode 100644 index 6d2bc3a8..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the builtin `env` implement the option `-u` to unset environment variables. diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/non-posix b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/non-posix deleted file mode 100644 index 8b9aeabf..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/non-posix +++ /dev/null @@ -1 +0,0 @@ -`env -u` is not registered in the POSIX standard. diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stderr b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdin b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdin deleted file mode 100644 index 96a4be3f..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdin +++ /dev/null @@ -1 +0,0 @@ -env -u HOME -u PATH -u TESTVARIABLE ./display_env diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdout b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdout deleted file mode 100644 index 93c94f83..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/001-unset-variables/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to_not match_regex "HOME=" -expected_to_not match_regex "PATH=" -expected_to_not match_regex "TESTVARIABLE=" diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/README.md b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/README.md deleted file mode 100644 index 2061f8c0..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# 002-unset-and-set-variable - -*[spec > bonuses > builtins > env](..) > 002-unset-and-set-variable* - -The purpose of this test is to check if env -u works to unset variables for a given binary, we are also checking if an argument not prefix with -u is add to the environment of the given binary.### What is done before test - -```bash -# unset all environment variables except PATH -for VARIABLE in $(env | awk 'BEGIN {FS="="} $0 !~ /^PATH/ {print $1}'); do unset "${VARIABLE}"; done; - -export HOME="/my/home" - -``` - -### Shell commands that are sent to the standard entry - -```bash -env -u HOME TESTVARIABLE=${GLOBAL_TOKEN} ./display_env - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^TESTVARIABLE=${GLOBAL_TOKEN}$" -expected_to_not match_regex "^HOME=" - -``` - -### What is expected on error output - -```bash -expected_to be_empty -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/before_exec b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/before_exec deleted file mode 100644 index 072acc45..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/before_exec +++ /dev/null @@ -1,4 +0,0 @@ -# unset all environment variables except PATH -for VARIABLE in $(env | awk 'BEGIN {FS="="} $0 !~ /^PATH/ {print $1}'); do unset "${VARIABLE}"; done; - -export HOME="/my/home" diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/description b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/description deleted file mode 100644 index d1d70325..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check if env -u works to unset variables for a given binary, we are also checking if an argument not prefix with -u is add to the environment of the given binary. \ No newline at end of file diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/non-posix b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/non-posix deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/pending b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/pending deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stderr b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stderr deleted file mode 100644 index c703fdc6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty \ No newline at end of file diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdin b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdin deleted file mode 100644 index afb12db8..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdin +++ /dev/null @@ -1 +0,0 @@ -env -u HOME TESTVARIABLE=${GLOBAL_TOKEN} ./display_env diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdout b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdout deleted file mode 100644 index 4afc77a6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/002-unset-and-set-variable/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "^TESTVARIABLE=${GLOBAL_TOKEN}$" -expected_to_not match_regex "^HOME=" diff --git a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/README.md b/42sh/42shelltest-tmp/spec/bonuses/builtins/env/README.md deleted file mode 100644 index 905bafab..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/builtins/env/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# env - -*[spec > bonuses > builtins](..) > env* - -* [001-unset-variables](./001-unset-variables) -* [002-unset-and-set-variable](./002-unset-and-set-variable) diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/README.md b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/README.md deleted file mode 100644 index ebadd59e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# 001-modifies-child-environment-1 - -*[spec > bonuses > inline-environment-variable](..) > 001-modifies-child-environment-1* - -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. -### What is done before test - -```bash -unset "${GLOBAL_TOKEN}_VARIABLE" - -``` - -### Shell commands that are sent to the standard entry - -```bash -${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE ./display_env -./display_env - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE$" once - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/before_exec b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/before_exec deleted file mode 100644 index 3d157a65..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -unset "${GLOBAL_TOKEN}_VARIABLE" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/description b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/description deleted file mode 100644 index 867b9a4c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stderr b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdin b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdin deleted file mode 100644 index ac8a9dc1..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdin +++ /dev/null @@ -1,2 +0,0 @@ -${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE ./display_env -./display_env diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdout b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdout deleted file mode 100644 index d0fe972f..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE$" once diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/README.md b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/README.md deleted file mode 100644 index 11e1e15e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# 002-modifies-child-environment-2 - -*[spec > bonuses > inline-environment-variable](..) > 002-modifies-child-environment-2* - -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. -### What is done before test - -```bash -unset "${GLOBAL_TOKEN}_VARIABLE" - -``` - -### Shell commands that are sent to the standard entry - -```bash -${GLOBAL_TOKEN}_VARIABLE1=${GLOBAL_TOKEN}_VALUE1 ${GLOBAL_TOKEN}_VARIABLE2=${GLOBAL_TOKEN}_VALUE2 ${GLOBAL_TOKEN}_VARIABLE3=${GLOBAL_TOKEN}_VALUE3 ./display_env -./display_env - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE1=${GLOBAL_TOKEN}_VALUE1$" once -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE2=${GLOBAL_TOKEN}_VALUE2$" once -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE3=${GLOBAL_TOKEN}_VALUE3$" once - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/before_exec b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/before_exec deleted file mode 100644 index 3d157a65..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -unset "${GLOBAL_TOKEN}_VARIABLE" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/description b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/description deleted file mode 100644 index 867b9a4c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stderr b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdin b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdin deleted file mode 100644 index 41cea892..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdin +++ /dev/null @@ -1,2 +0,0 @@ -${GLOBAL_TOKEN}_VARIABLE1=${GLOBAL_TOKEN}_VALUE1 ${GLOBAL_TOKEN}_VARIABLE2=${GLOBAL_TOKEN}_VALUE2 ${GLOBAL_TOKEN}_VARIABLE3=${GLOBAL_TOKEN}_VALUE3 ./display_env -./display_env diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdout b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdout deleted file mode 100644 index 37f7aa70..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE1=${GLOBAL_TOKEN}_VALUE1$" once -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE2=${GLOBAL_TOKEN}_VALUE2$" once -expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE3=${GLOBAL_TOKEN}_VALUE3$" once diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/README.md b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/README.md deleted file mode 100644 index da2c274f..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# 003-modifies-PATH-only - -*[spec > bonuses > inline-environment-variable](..) > 003-modifies-PATH-only* - -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. -### What is done before test - -```bash -rm -rf "temporary_directory" -mkdir -p "temporary_directory" -cd "temporary_directory" - -``` - -### Shell commands that are sent to the standard entry - -```bash -PATH=.. write_on_stdout ${GLOBAL_TOKEN} -exit_with_status 42 - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^${GLOBAL_TOKEN}$" - -``` - -### What is expected on error output - -```bash -expected_to_not be_empty -might match_regex "[Cc]ommand not found" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to_not exit_with_status "42" -expected_to_not exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/before_exec b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/before_exec deleted file mode 100644 index 6da5ae48..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/before_exec +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf "temporary_directory" -mkdir -p "temporary_directory" -cd "temporary_directory" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/description b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/description deleted file mode 100644 index 867b9a4c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/misc b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/misc deleted file mode 100644 index b982085d..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/misc +++ /dev/null @@ -1,2 +0,0 @@ -expected_to_not exit_with_status "42" -expected_to_not exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stderr b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stderr deleted file mode 100644 index e259629c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stderr +++ /dev/null @@ -1,2 +0,0 @@ -expected_to_not be_empty -might match_regex "[Cc]ommand not found" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdin b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdin deleted file mode 100644 index e318f09a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdin +++ /dev/null @@ -1,2 +0,0 @@ -PATH=.. write_on_stdout ${GLOBAL_TOKEN} -exit_with_status 42 diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdout b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdout deleted file mode 100644 index ba5eb86a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "^${GLOBAL_TOKEN}$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/README.md b/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/README.md deleted file mode 100644 index b210b586..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/inline-environment-variable/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# inline-environment-variable - -*[spec > bonuses](..) > inline-environment-variable* - -* [001-modifies-child-environment-1](./001-modifies-child-environment-1) -* [002-modifies-child-environment-2](./002-modifies-child-environment-2) -* [003-modifies-PATH-only](./003-modifies-PATH-only) diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/README.md b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/README.md deleted file mode 100644 index 6c5fa14c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# 001-append-twice-outputs-together - -*[spec > bonuses > redirections](..) > 001-append-twice-outputs-together* - -A double right redirection opens the file with the oflag `O_APPEND`, so that its size is not truncated to 0 and output is written at the end of file. If the file does not exist, it is created. -In this test, twice outputs are appended to the same file. -### What is done before test - -```bash -rm -f "new_file_stderr_and_stdout" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr &>>new_file_stderr_and_stdout - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### What is expected on error output - -```bash -expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to create_file "new_file_stderr_and_stdout" matching_regex "${GLOBAL_TOKEN}_stdout$" -expected_to create_file "new_file_stderr_and_stdout" matching_regex "${GLOBAL_TOKEN}_stderr$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/before_exec b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/before_exec deleted file mode 100644 index 21a08a3e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/before_exec +++ /dev/null @@ -1 +0,0 @@ -rm -f "new_file_stderr_and_stdout" diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/description b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/description deleted file mode 100644 index 9f258f1d..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/description +++ /dev/null @@ -1,2 +0,0 @@ -A double right redirection opens the file with the oflag `O_APPEND`, so that its size is not truncated to 0 and output is written at the end of file. If the file does not exist, it is created. -In this test, twice outputs are appended to the same file. diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/hard b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/hard deleted file mode 100644 index ac178a36..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/hard +++ /dev/null @@ -1 +0,0 @@ -This test only succeed with the reference ZSH. diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/misc b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/misc deleted file mode 100644 index 5ff4505a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/misc +++ /dev/null @@ -1,2 +0,0 @@ -expected_to create_file "new_file_stderr_and_stdout" matching_regex "${GLOBAL_TOKEN}_stdout$" -expected_to create_file "new_file_stderr_and_stdout" matching_regex "${GLOBAL_TOKEN}_stderr$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/non-posix b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/non-posix deleted file mode 100644 index c009338b..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/non-posix +++ /dev/null @@ -1 +0,0 @@ -The POSIX standard does not specify the capability for a Shell to append twice outputs to the same file. diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/pending b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/pending deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stderr b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stderr deleted file mode 100644 index 954fde45..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdin b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdin deleted file mode 100644 index 95ebe4a6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr &>>new_file_stderr_and_stdout diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdout b/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdout deleted file mode 100644 index edd840fd..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/001-append-twice-outputs-together/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/42shelltest-tmp/spec/bonuses/redirections/README.md b/42sh/42shelltest-tmp/spec/bonuses/redirections/README.md deleted file mode 100644 index 3fb4835b..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/redirections/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# redirections - -*[spec > bonuses](..) > redirections* - -* [001-append-twice-outputs-together](./001-append-twice-outputs-together) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/README.md deleted file mode 100644 index baa8d80a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# separators - -*[spec > bonuses](..) > separators* - -* [and](./and) -* [mixed](./mixed) -* [or](./or) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/README.md deleted file mode 100644 index fac73ee7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 001-run-twice - -*[spec > bonuses > separators > and](..) > 001-run-twice* - -The purpose of this test is to check that the AND operator `&&` works with two valid commands. -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ${GLOBAL_TOKEN}_LEFT && ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT - -``` - -### What is expected on standard output - -```bash -might match_regex "${GLOBAL_TOKEN}_LEFT" -might match_regex "${GLOBAL_TOKEN}_RIGHT" - -``` - -### What is expected on error output - -```bash -might be_empty - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/description b/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/description deleted file mode 100644 index 6c60d378..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the AND operator `&&` works with two valid commands. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stderr deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stderr +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdin deleted file mode 100644 index 793e144e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ${GLOBAL_TOKEN}_LEFT && ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdout deleted file mode 100644 index 65f5ef3a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/001-run-twice/stdout +++ /dev/null @@ -1,2 +0,0 @@ -might match_regex "${GLOBAL_TOKEN}_LEFT" -might match_regex "${GLOBAL_TOKEN}_RIGHT" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/README.md deleted file mode 100644 index b365c1ab..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# 002-do-not-run-second - -*[spec > bonuses > separators > and](..) > 002-do-not-run-second* - -The purpose of this test is to check that the AND operator `&&` makes the right command to not be executed if the left one exits with an error status code. -The Shell should exit with the status code of the executed command. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 42 && ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might_not match_regex ${GLOBAL_TOKEN} -might be_empty - -``` - -### What is expected on error output - -```bash -might be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -might exit_with_status "42" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/description b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/description deleted file mode 100644 index f85a5e86..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/description +++ /dev/null @@ -1,2 +0,0 @@ -The purpose of this test is to check that the AND operator `&&` makes the right command to not be executed if the left one exits with an error status code. -The Shell should exit with the status code of the executed command. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/misc deleted file mode 100644 index cdd865a4..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/misc +++ /dev/null @@ -1 +0,0 @@ -might exit_with_status "42" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stderr deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stderr +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdin deleted file mode 100644 index 486986fc..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 42 && ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdout deleted file mode 100644 index b01a27a5..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/002-do-not-run-second/stdout +++ /dev/null @@ -1,2 +0,0 @@ -might_not match_regex ${GLOBAL_TOKEN} -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/README.md deleted file mode 100644 index 8f02b390..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# 003-run-until-failing - -*[spec > bonuses > separators > and](..) > 003-run-until-failing* - -The purpose of this test is to check that using the AND separator `&&` with chained commands results in the execution of all until the first fail. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 0 && ./exit_with_status 0 && ./exit_with_status 0 && ./exit_with_status 0 && ./write_on_stdout ${GLOBAL_TOKEN}_FIRST && ./exit_with_status 42 && ./write_on_stdout ${GLOBAL_TOKEN}_SECOND - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_FIRST" -expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "42" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/description b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/description deleted file mode 100644 index 9d47e372..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the AND separator `&&` with chained commands results in the execution of all until the first fail. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/misc deleted file mode 100644 index 1983dc76..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "42" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdin deleted file mode 100644 index ade933dd..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 0 && ./exit_with_status 0 && ./exit_with_status 0 && ./exit_with_status 0 && ./write_on_stdout ${GLOBAL_TOKEN}_FIRST && ./exit_with_status 42 && ./write_on_stdout ${GLOBAL_TOKEN}_SECOND diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdout deleted file mode 100644 index 16c3d329..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/003-run-until-failing/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_FIRST" -expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/README.md deleted file mode 100644 index 0465749c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# and - -*[spec > bonuses > separators](..) > and* - -* [001-run-twice](./001-run-twice) -* [002-do-not-run-second](./002-do-not-run-second) -* [003-run-until-failing](./003-run-until-failing) -* [errors](./errors) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/README.md deleted file mode 100644 index 0f0af336..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# 001-parse-error-at-beginning - -*[spec > bonuses > separators > and > errors](..) > 001-parse-error-at-beginning* - -Parsing test. -The purpose of this test is to check that the AND operator `&&` must be placed after a valid command. -If not, the Shell should display an error and exit with an error status code. -### Shell commands that are sent to the standard entry - -```bash -&& ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might_not match_regex "${GLOBAL_TOKEN}" -might be_empty - -``` - -### What is expected on error output - -```bash -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" - -``` - -### What miscellaneous behaviors are expected - -```bash -might_not exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/description b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/description deleted file mode 100644 index 680a6627..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/description +++ /dev/null @@ -1,3 +0,0 @@ -Parsing test. -The purpose of this test is to check that the AND operator `&&` must be placed after a valid command. -If not, the Shell should display an error and exit with an error status code. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/misc deleted file mode 100644 index c4b48f73..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/misc +++ /dev/null @@ -1 +0,0 @@ -might_not exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stderr deleted file mode 100644 index 19c209de..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stderr +++ /dev/null @@ -1,2 +0,0 @@ -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdin deleted file mode 100644 index dc4ada22..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdin +++ /dev/null @@ -1 +0,0 @@ -&& ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdout deleted file mode 100644 index f78d19db..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdout +++ /dev/null @@ -1,2 +0,0 @@ -might_not match_regex "${GLOBAL_TOKEN}" -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/README.md deleted file mode 100644 index f2c640f6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# 002-parse-error-too-much-symbol - -*[spec > bonuses > separators > and > errors](..) > 002-parse-error-too-much-symbol* - -Parsing test. -The purpose of this test is to check that more than two '&' operators are detected as a syntax error. -It should not execute the two commands `write_on_stdout` but display an error and exit with an error status code. -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ${GLOBAL_TOKEN} &&& ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might_not match_regex "${GLOBAL_TOKEN}" -might be_empty - -``` - -### What is expected on error output - -```bash -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to_not exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/description b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/description deleted file mode 100644 index 00c27154..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/description +++ /dev/null @@ -1,3 +0,0 @@ -Parsing test. -The purpose of this test is to check that more than two '&' operators are detected as a syntax error. -It should not execute the two commands `write_on_stdout` but display an error and exit with an error status code. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/misc deleted file mode 100644 index 55d07cd5..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to_not exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stderr deleted file mode 100644 index 19c209de..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stderr +++ /dev/null @@ -1,2 +0,0 @@ -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdin deleted file mode 100644 index d43aa5f0..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ${GLOBAL_TOKEN} &&& ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdout deleted file mode 100644 index f78d19db..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdout +++ /dev/null @@ -1,2 +0,0 @@ -might_not match_regex "${GLOBAL_TOKEN}" -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/README.md deleted file mode 100644 index 60f1730e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/and/errors/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# errors - -*[spec > bonuses > separators > and](..) > errors* - -* [001-parse-error-at-beginning](./001-parse-error-at-beginning) -* [002-parse-error-too-much-symbol](./002-parse-error-too-much-symbol) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/README.md deleted file mode 100644 index 80ffeffc..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 001-and-or - -*[spec > bonuses > separators > mixed](..) > 001-and-or* - -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 42 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/description deleted file mode 100644 index bfa3fc16..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/misc deleted file mode 100644 index fe5959b7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdin deleted file mode 100644 index ead446bc..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 42 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdout deleted file mode 100644 index 258a6d56..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/001-and-or/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/README.md deleted file mode 100644 index 254641b3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 002-and-or - -*[spec > bonuses > separators > mixed](..) > 002-and-or* - -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 0 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" - -``` - -### What is expected on error output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/description deleted file mode 100644 index bfa3fc16..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/misc deleted file mode 100644 index fe5959b7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stderr deleted file mode 100644 index e9c877c3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdin deleted file mode 100644 index 7513ed7b..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 0 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdout deleted file mode 100644 index 258a6d56..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/002-and-or/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/README.md deleted file mode 100644 index 1fe553ef..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 003-and-or - -*[spec > bonuses > separators > mixed](..) > 003-and-or* - -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 0 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/description deleted file mode 100644 index bfa3fc16..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators AND `&&` and OR `||` applies the good logic: The second command is executed if the first one succeeds, and the third command is executed if the second one fails or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/misc deleted file mode 100644 index fe5959b7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdin deleted file mode 100644 index e695ff1a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 0 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdout deleted file mode 100644 index 258a6d56..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/003-and-or/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/README.md deleted file mode 100644 index 50c645e9..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 004-or-and - -*[spec > bonuses > separators > mixed](..) > 004-or-and* - -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 42 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS - -``` - -### What is expected on standard output - -```bash -expected_to be_empty - -``` - -### What is expected on error output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "21" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/description deleted file mode 100644 index fba00623..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/misc deleted file mode 100644 index 82d70611..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "21" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stderr deleted file mode 100644 index e9c877c3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdin deleted file mode 100644 index 29391e99..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 42 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdout deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/004-or-and/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/README.md deleted file mode 100644 index 608bfc49..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 005-or-and - -*[spec > bonuses > separators > mixed](..) > 005-or-and* - -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" - -``` - -### What is expected on error output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "21" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/description deleted file mode 100644 index fba00623..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/misc deleted file mode 100644 index 82d70611..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "21" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stderr deleted file mode 100644 index e9c877c3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_ERROR" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdin deleted file mode 100644 index 6d9fee3a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdout deleted file mode 100644 index 258a6d56..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/005-or-and/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/README.md deleted file mode 100644 index 41fe8559..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 006-or-and - -*[spec > bonuses > separators > mixed](..) > 006-or-and* - -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 0 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/description b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/description deleted file mode 100644 index fba00623..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the two separators OR `||` and AND `&&` applies the good logic: The second command is executed if the first one fails, and the third command is executed if the second one succeeds or is not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/misc deleted file mode 100644 index fe5959b7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdin deleted file mode 100644 index 7dab07c6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 0 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdout deleted file mode 100644 index 258a6d56..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/006-or-and/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/README.md deleted file mode 100644 index a6863e70..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/mixed/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# mixed - -*[spec > bonuses > separators](..) > mixed* - -* [001-and-or](./001-and-or) -* [002-and-or](./002-and-or) -* [003-and-or](./003-and-or) -* [004-or-and](./004-or-and) -* [005-or-and](./005-or-and) -* [006-or-and](./006-or-and) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/README.md deleted file mode 100644 index 5dded6f3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 001-run-first-only - -*[spec > bonuses > separators > or](..) > 001-run-first-only* - -The purpose of this test is to check that the OR operator `||` makes the right command to not be executed if the left one exits with a success status. -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ${GLOBAL_TOKEN}_LEFT || ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT - -``` - -### What is expected on standard output - -```bash -might match_regex ${GLOBAL_TOKEN}_LEFT -might_not match_regex ${GLOBAL_TOKEN}_RIGHT - -``` - -### What is expected on error output - -```bash -might be_empty - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/description b/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/description deleted file mode 100644 index faf0dca8..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the OR operator `||` makes the right command to not be executed if the left one exits with a success status. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stderr deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stderr +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdin deleted file mode 100644 index e167faf4..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ${GLOBAL_TOKEN}_LEFT || ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdout deleted file mode 100644 index 195b1a22..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/001-run-first-only/stdout +++ /dev/null @@ -1,2 +0,0 @@ -might match_regex ${GLOBAL_TOKEN}_LEFT -might_not match_regex ${GLOBAL_TOKEN}_RIGHT diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/README.md deleted file mode 100644 index 1e255e4c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 002-run-second-only - -*[spec > bonuses > separators > or](..) > 002-run-second-only* - -The purpose of this test is to check that the OR operator `||` makes the right command to be executed if the left one exits with an error status code. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might match_regex "${GLOBAL_TOKEN}" - -``` - -### What is expected on error output - -```bash -might be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -might exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/description b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/description deleted file mode 100644 index f8892296..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the OR operator `||` makes the right command to be executed if the left one exits with an error status code. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/misc deleted file mode 100644 index fd805999..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/misc +++ /dev/null @@ -1 +0,0 @@ -might exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stderr deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stderr +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdin deleted file mode 100644 index fc0472c0..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdout deleted file mode 100644 index bbdd98ff..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/002-run-second-only/stdout +++ /dev/null @@ -1 +0,0 @@ -might match_regex "${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/README.md deleted file mode 100644 index 0797860a..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# 003-run-until-succeeding - -*[spec > bonuses > separators > or](..) > 003-run-until-succeeding* - -The purpose of this test is to check that using the OR separator `||` with chained commands results in the execution of all until the first succeed. The remaining commands are not executed. -### Shell commands that are sent to the standard entry - -```bash -./exit_with_status 1 || ./exit_with_status 2 || ./exit_with_status 3 || ./exit_with_status 4 || ./write_on_stdout ${GLOBAL_TOKEN}_FIRST || ./write_on_stdout ${GLOBAL_TOKEN}_SECOND - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_FIRST" -expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" - -``` - -### What is expected on error output - -```bash -expected_to be_empty - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/description b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/description deleted file mode 100644 index 960a362b..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that using the OR separator `||` with chained commands results in the execution of all until the first succeed. The remaining commands are not executed. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/misc deleted file mode 100644 index fe5959b7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stderr deleted file mode 100644 index 93b97883..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stderr +++ /dev/null @@ -1 +0,0 @@ -expected_to be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdin deleted file mode 100644 index 0f675560..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdin +++ /dev/null @@ -1 +0,0 @@ -./exit_with_status 1 || ./exit_with_status 2 || ./exit_with_status 3 || ./exit_with_status 4 || ./write_on_stdout ${GLOBAL_TOKEN}_FIRST || ./write_on_stdout ${GLOBAL_TOKEN}_SECOND diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdout deleted file mode 100644 index 16c3d329..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/003-run-until-succeeding/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_FIRST" -expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/README.md deleted file mode 100644 index a3b10c36..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# or - -*[spec > bonuses > separators](..) > or* - -* [001-run-first-only](./001-run-first-only) -* [002-run-second-only](./002-run-second-only) -* [003-run-until-succeeding](./003-run-until-succeeding) -* [errors](./errors) diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/README.md deleted file mode 100644 index 54b503ed..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# 001-parse-error-at-beginning - -*[spec > bonuses > separators > or > errors](..) > 001-parse-error-at-beginning* - -Parsing test. -The purpose of this test is to check that the OR operator `||` must be placed after a valid command. -If not, the Shell should display an error and exit with an error status code. -### Shell commands that are sent to the standard entry - -```bash -|| ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might be_empty - -``` - -### What is expected on error output - -```bash -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" - -``` - -### What miscellaneous behaviors are expected - -```bash -might_not exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/description b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/description deleted file mode 100644 index d29fb8ad..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/description +++ /dev/null @@ -1,3 +0,0 @@ -Parsing test. -The purpose of this test is to check that the OR operator `||` must be placed after a valid command. -If not, the Shell should display an error and exit with an error status code. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/misc deleted file mode 100644 index c4b48f73..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/misc +++ /dev/null @@ -1 +0,0 @@ -might_not exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stderr deleted file mode 100644 index 19c209de..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stderr +++ /dev/null @@ -1,2 +0,0 @@ -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdin deleted file mode 100644 index 9dfc6dbd..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdin +++ /dev/null @@ -1 +0,0 @@ -|| ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdout deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdout +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/README.md deleted file mode 100644 index 429f2119..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# 002-parse-error-too-much-symbol - -*[spec > bonuses > separators > or > errors](..) > 002-parse-error-too-much-symbol* - -Parsing test. -The purpose of this test is to check that using more than two pipe symbols `|` is detected as an error. -The Shell should display an error and exit with a error status code. -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ${GLOBAL_TOKEN} ||| ./write_on_stdout ${GLOBAL_TOKEN} - -``` - -### What is expected on standard output - -```bash -might be_empty - -``` - -### What is expected on error output - -```bash -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" - - -``` - -### What miscellaneous behaviors are expected - -```bash -might_not exit_with_status "0" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/description b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/description deleted file mode 100644 index 940ef752..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/description +++ /dev/null @@ -1,3 +0,0 @@ -Parsing test. -The purpose of this test is to check that using more than two pipe symbols `|` is detected as an error. -The Shell should display an error and exit with a error status code. diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/misc b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/misc deleted file mode 100644 index c4b48f73..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/misc +++ /dev/null @@ -1 +0,0 @@ -might_not exit_with_status "0" diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stderr b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stderr deleted file mode 100644 index a6382d38..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stderr +++ /dev/null @@ -1,3 +0,0 @@ -might_not be_empty -might match_regex "([Ss]yntax|[Pp]arse) error" - diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdin b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdin deleted file mode 100644 index 782254a3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ${GLOBAL_TOKEN} ||| ./write_on_stdout ${GLOBAL_TOKEN} diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdout b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdout deleted file mode 100644 index c0265b63..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdout +++ /dev/null @@ -1 +0,0 @@ -might be_empty diff --git a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/README.md b/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/README.md deleted file mode 100644 index babe06e9..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/separators/or/errors/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# errors - -*[spec > bonuses > separators > or](..) > errors* - -* [001-parse-error-at-beginning](./001-parse-error-at-beginning) -* [002-parse-error-too-much-symbol](./002-parse-error-too-much-symbol) diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/README.md deleted file mode 100644 index 8a45a52c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 001-expanded-with-HOME-1 - -*[spec > bonuses > tilde-expansion](..) > 001-expanded-with-HOME-1* - -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable HOME. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~ - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~" -expected_to match_regex "^/${GLOBAL_TOKEN}$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/description deleted file mode 100644 index 53e01191..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable HOME. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdin deleted file mode 100644 index 69307f14..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~ diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdout deleted file mode 100644 index 3c9d4ab8..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to_not match_regex "~" -expected_to match_regex "^/${GLOBAL_TOKEN}$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/README.md deleted file mode 100644 index cb16c351..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 002-expanded-with-HOME-2 - -*[spec > bonuses > tilde-expansion](..) > 002-expanded-with-HOME-2* - -The purpose of this test is to check that the symbol tilde `~` followed by the symbol slash `/` may be expanded with the environment variable HOME. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~/${GLOBAL_TOKEN}_SUBDIRECTORY - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~" -expected_to match_regex "^/${GLOBAL_TOKEN}/${GLOBAL_TOKEN}_SUBDIRECTORY$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/description deleted file mode 100644 index 2c601af5..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` followed by the symbol slash `/` may be expanded with the environment variable HOME. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdin deleted file mode 100644 index b806e8d9..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~/${GLOBAL_TOKEN}_SUBDIRECTORY diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdout deleted file mode 100644 index ddeb1db3..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to_not match_regex "~" -expected_to match_regex "^/${GLOBAL_TOKEN}/${GLOBAL_TOKEN}_SUBDIRECTORY$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/README.md deleted file mode 100644 index 3aa1a1e6..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# 003-expanded-with-PWD-1 - -*[spec > bonuses > tilde-expansion](..) > 003-expanded-with-PWD-1* - -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~+ - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~[+]" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/description deleted file mode 100644 index 545ed856..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdin deleted file mode 100644 index c2315545..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~+ diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdout deleted file mode 100644 index ec00fafb..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to_not match_regex "~[+]" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/README.md deleted file mode 100644 index 4f13fd38..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# 004-expanded-with-PWD-2 - -*[spec > bonuses > tilde-expansion](..) > 004-expanded-with-PWD-2* - -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~+/${GLOBAL_TOKEN}_SUBDIRECTORY - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~+/${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]/${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_SUBDIRECTORY$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/description deleted file mode 100644 index 545ed856..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdin deleted file mode 100644 index 019c6cf9..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~+/${GLOBAL_TOKEN}_SUBDIRECTORY diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdout deleted file mode 100644 index 23a27406..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to_not match_regex "~+/${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]/${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_SUBDIRECTORY$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/README.md deleted file mode 100644 index 7bbb14fd..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# 005-expanded-with-OLDPWD-1 - -*[spec > bonuses > tilde-expansion](..) > 005-expanded-with-OLDPWD-1* - -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. -### What is done before test - -```bash -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~- - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~-" -expected_to_not match_regex "/${GLOBAL_TOKEN}-" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/before_exec deleted file mode 100644 index 52fbb306..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/before_exec +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/description deleted file mode 100644 index 1cb05172..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdin deleted file mode 100644 index c9e75916..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdin +++ /dev/null @@ -1,2 +0,0 @@ -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~- diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdout deleted file mode 100644 index ff80be6f..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to_not match_regex "~-" -expected_to_not match_regex "/${GLOBAL_TOKEN}-" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/README.md deleted file mode 100644 index d6e59670..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# 006-expanded-with-OLDPWD-2 - -*[spec > bonuses > tilde-expansion](..) > 006-expanded-with-OLDPWD-2* - -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. -### What is done before test - -```bash -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~-/${GLOBAL_TOKEN}_OTHERDIRECTORY - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "~-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to_not match_regex "/${GLOBAL_TOKEN}-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_OTHERDIRECTORY$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/before_exec deleted file mode 100644 index 52fbb306..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/before_exec +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/description deleted file mode 100644 index 1cb05172..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdin deleted file mode 100644 index 76895961..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdin +++ /dev/null @@ -1,2 +0,0 @@ -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~-/${GLOBAL_TOKEN}_OTHERDIRECTORY diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdout deleted file mode 100644 index 1dbf719e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to_not match_regex "~-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to_not match_regex "/${GLOBAL_TOKEN}-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to match_regex "^${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_OTHERDIRECTORY$" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/README.md deleted file mode 100644 index 5c02470e..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# tilde-expansion - -*[spec > bonuses](..) > tilde-expansion* - -* [001-expanded-with-HOME-1](./001-expanded-with-HOME-1) -* [002-expanded-with-HOME-2](./002-expanded-with-HOME-2) -* [003-expanded-with-PWD-1](./003-expanded-with-PWD-1) -* [004-expanded-with-PWD-2](./004-expanded-with-PWD-2) -* [005-expanded-with-OLDPWD-1](./005-expanded-with-OLDPWD-1) -* [006-expanded-with-OLDPWD-2](./006-expanded-with-OLDPWD-2) -* [not-expanded](./not-expanded) diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/README.md deleted file mode 100644 index 4b7be101..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 001-not-expanded-with-HOME-1 - -*[spec > bonuses > tilde-expansion > not-expanded](..) > 001-not-expanded-with-HOME-1* - -The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~~ - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^~~$" -expected_to_not match_regex "/${GLOBAL_TOKEN}" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/description deleted file mode 100644 index 739f0907..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdin deleted file mode 100644 index fd5167ce..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~~ diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdout deleted file mode 100644 index 3160a089..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "^~~$" -expected_to_not match_regex "/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/README.md deleted file mode 100644 index 855ca035..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# 002-not-expanded-with-HOME-2 - -*[spec > bonuses > tilde-expansion > not-expanded](..) > 002-not-expanded-with-HOME-2* - -The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~${GLOBAL_TOKEN}_UNKNOWNUSER - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^~${GLOBAL_TOKEN}_UNKNOWNUSER$" -expected_to_not match_regex "/${GLOBAL_TOKEN}${GLOBAL_TOKEN}_UNKNOWNUSER" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/description deleted file mode 100644 index 739f0907..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdin deleted file mode 100644 index 3c0b74c7..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~${GLOBAL_TOKEN}_UNKNOWNUSER diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdout deleted file mode 100644 index 9a73fcf0..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "^~${GLOBAL_TOKEN}_UNKNOWNUSER$" -expected_to_not match_regex "/${GLOBAL_TOKEN}${GLOBAL_TOKEN}_UNKNOWNUSER" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/README.md deleted file mode 100644 index 065e5648..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# 003-not-expanded-with-PWD - -*[spec > bonuses > tilde-expansion > not-expanded](..) > 003-not-expanded-with-PWD* - -The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable PWD when not followed by the symbol `/`. -### What is done before test - -```bash -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -./write_on_stdout ~+${GLOBAL_TOKEN}_SUBDIRECTORY - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^~[+]${GLOBAL_TOKEN}_SUBDIRECTORY$" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to_not match_regex "${GLOBAL_TMP_DIRECTORY}${GLOBAL_TOKEN}_SUBDIRECTORY" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/before_exec deleted file mode 100644 index 2f825443..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/before_exec +++ /dev/null @@ -1 +0,0 @@ -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/description deleted file mode 100644 index 832e877c..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable PWD when not followed by the symbol `/`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdin deleted file mode 100644 index f0cc2677..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdin +++ /dev/null @@ -1 +0,0 @@ -./write_on_stdout ~+${GLOBAL_TOKEN}_SUBDIRECTORY diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdout deleted file mode 100644 index 53269842..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "^~[+]${GLOBAL_TOKEN}_SUBDIRECTORY$" -expected_to_not match_regex "/${GLOBAL_TOKEN}[+]${GLOBAL_TOKEN}_SUBDIRECTORY" -expected_to_not match_regex "${GLOBAL_TMP_DIRECTORY}${GLOBAL_TOKEN}_SUBDIRECTORY" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/README.md deleted file mode 100644 index e9813426..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# 004-not-expanded-with-OLDPWD - -*[spec > bonuses > tilde-expansion > not-expanded](..) > 004-not-expanded-with-OLDPWD* - -The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable OLDPWD when not followed by the symbol `/`. -### What is done before test - -```bash -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" - -``` - -### Shell commands that are sent to the standard entry - -```bash -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~-${GLOBAL_TOKEN}_OTHERDIRECTORY - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "^~-${GLOBAL_TOKEN}_OTHERDIRECTORY$" -expected_to_not match_regex "/${GLOBAL_TOKEN}-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to_not match_regex "${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_OTHERDIRECTORY" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/before_exec b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/before_exec deleted file mode 100644 index 52fbb306..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/before_exec +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf "./${GLOBAL_TOKEN}_SUBDIRECTORY" -mkdir "./${GLOBAL_TOKEN}_SUBDIRECTORY" -export "HOME=/${GLOBAL_TOKEN}" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/description b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/description deleted file mode 100644 index fad1aead..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable OLDPWD when not followed by the symbol `/`. diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdin b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdin deleted file mode 100644 index 4c3cec62..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdin +++ /dev/null @@ -1,2 +0,0 @@ -cd ./${GLOBAL_TOKEN}_SUBDIRECTORY -${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~-${GLOBAL_TOKEN}_OTHERDIRECTORY diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdout b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdout deleted file mode 100644 index 1ed88c70..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "^~-${GLOBAL_TOKEN}_OTHERDIRECTORY$" -expected_to_not match_regex "/${GLOBAL_TOKEN}-/${GLOBAL_TOKEN}_OTHERDIRECTORY" -expected_to_not match_regex "${GLOBAL_TMP_DIRECTORY}/${GLOBAL_TOKEN}_OTHERDIRECTORY" diff --git a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/README.md b/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/README.md deleted file mode 100644 index bdb7eabc..00000000 --- a/42sh/42shelltest-tmp/spec/bonuses/tilde-expansion/not-expanded/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# not-expanded - -*[spec > bonuses > tilde-expansion](..) > not-expanded* - -* [001-not-expanded-with-HOME-1](./001-not-expanded-with-HOME-1) -* [002-not-expanded-with-HOME-2](./002-not-expanded-with-HOME-2) -* [003-not-expanded-with-PWD](./003-not-expanded-with-PWD) -* [004-not-expanded-with-OLDPWD](./004-not-expanded-with-OLDPWD) diff --git a/42sh/42shelltest-tmp/support/create-file/Makefile b/42sh/42shelltest-tmp/support/create-file/Makefile deleted file mode 100644 index 2b1425d1..00000000 --- a/42sh/42shelltest-tmp/support/create-file/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=create-file -TARGET_DIR=. - -$(NAME): all - -all: - gcc -Wall -Werror -Wextra main.c -o "$(TARGET_DIR)/$(NAME)" - -fclean: - rm -f "$(TARGET_DIR)/$(NAME)" - -re: fclean all diff --git a/42sh/42shelltest-tmp/support/create-file/README.md b/42sh/42shelltest-tmp/support/create-file/README.md deleted file mode 100644 index 826dd1ec..00000000 --- a/42sh/42shelltest-tmp/support/create-file/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# ./create_file - -A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" - -```c -#include -#include - -int main(int argc, char **argv) -{ - char *name; - static char filename[1000]; - - (void)argc; - if (!argv[1]) - strcat(filename, "TOKEN"); - else - strcat(filename, argv[1]); - name = "_FILE"; - strcat(filename, name); - creat(filename, 0644); - return (0); -} -``` diff --git a/42sh/42shelltest-tmp/support/create-file/description b/42sh/42shelltest-tmp/support/create-file/description deleted file mode 100644 index 16c774d5..00000000 --- a/42sh/42shelltest-tmp/support/create-file/description +++ /dev/null @@ -1 +0,0 @@ -A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" diff --git a/42sh/42shelltest-tmp/support/create-file/main.c b/42sh/42shelltest-tmp/support/create-file/main.c deleted file mode 100644 index a00b65fc..00000000 --- a/42sh/42shelltest-tmp/support/create-file/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - char *name; - static char filename[1000]; - - (void)argc; - if (!argv[1]) - strcat(filename, "TOKEN"); - else - strcat(filename, argv[1]); - name = "_FILE"; - strcat(filename, name); - creat(filename, 0644); - return (0); -} diff --git a/42sh/42shelltest-tmp/support/delete-file/Makefile b/42sh/42shelltest-tmp/support/delete-file/Makefile deleted file mode 100644 index 31aa7711..00000000 --- a/42sh/42shelltest-tmp/support/delete-file/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=delete-file -TARGET_DIR=. - -$(NAME): all - -all: - gcc -Wall -Werror -Wextra main.c -o "$(TARGET_DIR)/$(NAME)" - -fclean: - rm -f "$(TARGET_DIR)/$(NAME)" - -re: fclean all diff --git a/42sh/42shelltest-tmp/support/delete-file/README.md b/42sh/42shelltest-tmp/support/delete-file/README.md deleted file mode 100644 index f82c81f4..00000000 --- a/42sh/42shelltest-tmp/support/delete-file/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# ./delete_file - -A binary that delete all files called in argument. - -```c -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - char buf[PATH_MAX + 1]; - - while (argc > 0) - { - bzero(buf, PATH_MAX + 1); - realpath(argv[argc--], buf); - remove(buf); - } - return (0); -} -``` diff --git a/42sh/42shelltest-tmp/support/delete-file/description b/42sh/42shelltest-tmp/support/delete-file/description deleted file mode 100644 index 11d62594..00000000 --- a/42sh/42shelltest-tmp/support/delete-file/description +++ /dev/null @@ -1 +0,0 @@ -A binary that delete all files called in argument. diff --git a/42sh/42shelltest-tmp/support/delete-file/main.c b/42sh/42shelltest-tmp/support/delete-file/main.c deleted file mode 100644 index 3ea74f79..00000000 --- a/42sh/42shelltest-tmp/support/delete-file/main.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - char buf[PATH_MAX + 1]; - - while (argc > 0) - { - bzero(buf, PATH_MAX + 1); - realpath(argv[argc--], buf); - remove(buf); - } - return (0); -} diff --git a/42sh/42shelltest-tmp/support/read-on-stdin-once/Makefile b/42sh/42shelltest-tmp/support/read-on-stdin-once/Makefile deleted file mode 100644 index b041522a..00000000 --- a/42sh/42shelltest-tmp/support/read-on-stdin-once/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=read_on_stdin_once -TARGET_DIR=. - -$(NAME): all - -all: - gcc -Wall -Werror -Wextra main.c -o "$(TARGET_DIR)/$(NAME)" - -fclean: - rm -f "$(TARGET_DIR)/$(NAME)" - -re: fclean all diff --git a/42sh/42shelltest-tmp/support/read-on-stdin-once/description b/42sh/42shelltest-tmp/support/read-on-stdin-once/description deleted file mode 100644 index 801c328f..00000000 --- a/42sh/42shelltest-tmp/support/read-on-stdin-once/description +++ /dev/null @@ -1 +0,0 @@ -A binary that reads 1024 bytes on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. Reads only a once. diff --git a/42sh/42shelltest-tmp/support/read-on-stdin-once/main.c b/42sh/42shelltest-tmp/support/read-on-stdin-once/main.c deleted file mode 100644 index d1ca00d1..00000000 --- a/42sh/42shelltest-tmp/support/read-on-stdin-once/main.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -int main(void) -{ - char buf[1024]; - int ret; - - if ((ret = read(0, buf, 1024))) - { - write(1, buf, ret); - write(1, "@", 1); - } - if (ret < 0) - { - write(2, "STDIN READ ERROR\n", 17); - return (1); - } - return (0); -} diff --git a/42sh/42shelltest-tmp/support/read-on-stdin/README.md b/42sh/42shelltest-tmp/support/read-on-stdin/README.md deleted file mode 100644 index 69399bf0..00000000 --- a/42sh/42shelltest-tmp/support/read-on-stdin/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# ./read_on_stdin - -A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. - -```c -#include -#include - -int main(void) -{ - char buf[1]; - int ret; - - while ((ret = read(0, buf, 1)) > 0) - { - if (buf[0] == '\n') - write(1, "@", 1); - write(1, buf, ret); - } - if (ret < 0) - { - write(2, "STDIN READ ERROR\n", 17); - return (1); - } - return (0); -} -``` diff --git a/42sh/TESTSHELL/simple_cmd/echo.test b/42sh/TESTSHELL/simple_cmd/echo.test deleted file mode 100644 index 3997594c..00000000 --- a/42sh/TESTSHELL/simple_cmd/echo.test +++ /dev/null @@ -1 +0,0 @@ -echo 'je suis un test' diff --git a/42sh/TESTSHELL/simple_cmd/ls.test b/42sh/TESTSHELL/simple_cmd/ls.test deleted file mode 100644 index 9e2740c6..00000000 --- a/42sh/TESTSHELL/simple_cmd/ls.test +++ /dev/null @@ -1 +0,0 @@ -ls diff --git a/42sh/TESTSHELL/simple_cmd/pwd.test b/42sh/TESTSHELL/simple_cmd/pwd.test deleted file mode 100644 index f748bdd0..00000000 --- a/42sh/TESTSHELL/simple_cmd/pwd.test +++ /dev/null @@ -1 +0,0 @@ -pwd diff --git a/42sh/TESTSHELL/stderr_ref b/42sh/TESTSHELL/stderr_ref deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/TESTSHELL/stderr_test b/42sh/TESTSHELL/stderr_test deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/TESTSHELL/stdin_ref b/42sh/TESTSHELL/stdin_ref deleted file mode 100644 index b689ff6b..00000000 --- a/42sh/TESTSHELL/stdin_ref +++ /dev/null @@ -1,14 +0,0 @@ -42sh -Makefile -TESTSHELL -donovan_segaults_06-02 -file1 -file2 -includes -libft -objs -pdf -sample -src -test_framework.sh -update_makefile.sh diff --git a/42sh/TESTSHELL/stdin_test b/42sh/TESTSHELL/stdin_test deleted file mode 100644 index 4b6a7bbd..00000000 --- a/42sh/TESTSHELL/stdin_test +++ /dev/null @@ -1,43 +0,0 @@ - main.c 107start of shell JOBC is ON - token_print.c 21 token print - token_print.c 25 token : TK_WORD data [ls] - - insert_newline.c 19 insert newline - ft_parse.c 45  - - build_tree.c 83 func TK : 'TK_WORD' TK : 'TK_WORD' - add_cmd.c 55 add data - ft_parse.c 45  - - build_tree.c 83 func TK : 'TK_NEWLINE' TK : 'TK_NEWLINE' - add_sep.c 21 add sep - ft_parse.c 45  - - ft_parse.c 58 sucessful parsing - main.c 64 Before execution: - NEW - +----+ - CMD - ft_exec.c 39  - ft_exec.c 48 match : TK_NEWLINE and TK_NEWLINE - exec_semi.c 20  - exec_semi.c 22  - ft_exec.c 39  - ft_exec.c 48 match : NON-DEFINED and NON-DEFINED - exec_command.c 52 op=2118139328 -42sh -Makefile -TESTSHELL -donovan_segaults_06-02 -file1 -file2 -includes -libft -objs -pdf -sample -src -test_framework.sh -update_makefile.sh - exec_semi.c 24  - ft_exec.c 39  diff --git a/42sh/file1 b/42sh/file1 deleted file mode 100644 index cc628ccd..00000000 --- a/42sh/file1 +++ /dev/null @@ -1 +0,0 @@ -world diff --git a/42sh/minishell_error b/42sh/minishell_error new file mode 100644 index 00000000..7fc58653 --- /dev/null +++ b/42sh/minishell_error @@ -0,0 +1,562 @@ +...x...~......xx....~.~.~..........xxx....xxx...~.xxx. + +---------------------------------------------------------------- + +minishell/binary/004-binary-test-empty-path (FAILED) + + Description: + The purpose of this test is to check that the Shell finds binaries that are located in the current directory when the environment variable PATH is empty. + + Before test: + 01: export PATH="" + + STDIN: + 01: write_on_stdout "TOKEN201703241735" + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241735` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: command not found: write_on_stdout + + MISC: + FAILURE expected_to exit_with_status `0` + +---------------------------------------------------------------- + +minishell/binary/008-binary-too-many-symbolic-links-encountered (WARNING) + + Description: + The purpose of this test is to check that trying to execute a path that encounters an infinite loop of symbolic link results in an error on standard error and a failure exit status. + + Before test: + 01: rm -rf ./symbolic_link1 ./symbolic_link2 ./symbolic_link3 + 02: ln -s ./symbolic_link1 ./symbolic_link2 + 03: ln -s ./symbolic_link2 ./symbolic_link3 + 04: ln -s ./symbolic_link3 ./symbolic_link1 + + STDIN: + 01: ./symbolic_link1 + + STDOUT: + SUCCESS might be_empty + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `[Tt]oo many.*symbolic links` + 01: ../../42sh: ./symbolic_link1: no such file or directory + + MISC: + SUCCESS expected_to_not exit_with_status 0 + +---------------------------------------------------------------- + +minishell/builtins/cd/007-symbolic-link (FAILED) + + Description: + The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving the linked directory. + + Before test: + 01: rm -f "./symbolic_link" + 02: mkdir -p "./sub_directory" + 03: ln -s "./sub_directory" "./symbolic_link" + + STDIN: + 01: cd symbolic_link + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd + 03: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_env + + STDOUT: + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD$` + FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/symbolic_link$` + 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD + 02: ------------------------------ + 03: TERM_PROGRAM=iTerm.app + 04: TERM=screen-256color + 05: SHELL=/bin/zsh + 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 09: TERM_PROGRAM_VERSION=3.0.10 + 10: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 11: ZSH=/Users/ariard/.oh-my-zsh + 12: USER=ariard + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 15: PAGER=less + 16: TMUX=/private/tmp/tmux-18965/default,73780,2 + 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 18: LSCOLORS=Gxfxcxdxbxegedabagacad + 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 20: MAIL=ariard@student.42.fr + 21: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory + 22: LANG=en_US.UTF-8 + 23: ITERM_PROFILE=Default + 24: XPC_FLAGS=0x0 + 25: TMUX_PANE=%9 + 26: XPC_SERVICE_NAME=0 + 27: SHLVL=4 + 28: HOME=/Users/ariard + 29: COLORFGBG=7;0 + 30: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 31: LOGNAME=ariard + 32: LESS=-R + 33: LC_CTYPE=en_US.UTF-8 + 34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 35: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 36: _=../../42sh + 37: ?=0 + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +minishell/builtins/cd/008-symbolic-link-2 (FAILED) + + Description: + The purpose of this test is to check that using a symbolic link as first argument with the builtin `cd` results in moving to the linked directory. In this test, the directory is linked with to chained symbolic links. + + Before test: + 01: rm -f "./symbolic_link1" "./symbolic_link2" + 02: mkdir -p "./sub_directory" + 03: ln -s "./sub_directory" "./symbolic_link1" + 04: ln -s "./symbolic_link1" "./symbolic_link2" + + STDIN: + 01: cd symbolic_link2 + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd + 03: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_env + + STDOUT: + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD$` + FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/symbolic_link2$` + 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory:PWD + 02: ------------------------------ + 03: TERM_PROGRAM=iTerm.app + 04: TERM=screen-256color + 05: SHELL=/bin/zsh + 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp + 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.LmcFivfwkY/Render + 09: TERM_PROGRAM_VERSION=3.0.10 + 10: TERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 11: ZSH=/Users/ariard/.oh-my-zsh + 12: USER=ariard + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u4JR4EZzBG/Listeners + 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 15: PAGER=less + 16: TMUX=/private/tmp/tmux-18965/default,73780,2 + 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 18: LSCOLORS=Gxfxcxdxbxegedabagacad + 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 20: MAIL=ariard@student.42.fr + 21: PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory + 22: LANG=en_US.UTF-8 + 23: ITERM_PROFILE=Default + 24: XPC_FLAGS=0x0 + 25: TMUX_PANE=%9 + 26: XPC_SERVICE_NAME=0 + 27: SHLVL=4 + 28: HOME=/Users/ariard + 29: COLORFGBG=7;0 + 30: ITERM_SESSION_ID=w0t0p1:D3D230F7-7E75-4A5C-B793-6A5C4DAD3F83 + 31: LOGNAME=ariard + 32: LESS=-R + 33: LC_CTYPE=en_US.UTF-8 + 34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ + 35: OLDPWD=/Users/ariard/Projects/42sh/42ShellTester/tmp + 36: _=../../42sh + 37: ?=0 + 38: ------------------------------ + 39: TOTAL ENVIRONMENT VARIABLES: 35 + + STDERR: + SUCCESS expected_to be_empty + (no output) + +---------------------------------------------------------------- + +minishell/builtins/cd/errors/001-not-a-directory (WARNING) + + Description: + The purpose of this test is to check that using a file name as first argument with the builtin `cd` results in error and not changing current directory. + + Before test: + 01: touch "./not_a_directory" + + STDIN: + 01: cd not_a_directory + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd + + STDOUT: + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `[Nn]ot a directory` + 01: ../../42sh: cd: no such file or directory: not_a_directory + +---------------------------------------------------------------- + +minishell/builtins/cd/errors/003-permission-denied (WARNING) + + Description: + The purpose of this test is to check that using a directory without any permission as first argument with the builtin `cd` results in error and not changing current directory. + + Before test: + 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi + 02: rm -rf "./permission_denied" + 03: mkdir -m 0 "./permission_denied" + + STDIN: + 01: cd permission_denied + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd + + STDOUT: + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `[Pp]ermission denied` + 01: ../../42sh: cd: no such file or directory: permission_denied + + After test: + 01: if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi + 02: rm -rf "./permission_denied" + +---------------------------------------------------------------- + +minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered (WARNING) + + Description: + The purpose of this test is to check that using a symbolic link resulting in ELOOP error as first argument with the builtin `cd` results in error and not changing current directory. + + Before test: + 01: rm -f "./symbolic_link1" "./symbolic_link2" "./symbolic_link3" + 02: ln -s "./symbolic_link1" "./symbolic_link2" + 03: ln -s "./symbolic_link2" "./symbolic_link3" + 04: ln -s "./symbolic_link3" "./symbolic_link1" + + STDIN: + 01: cd symbolic_link1 + 02: /Users/ariard/Projects/42sh/42ShellTester/tmp/display_pwd + + STDOUT: + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `[Tt]oo many.*symbolic links` + 01: ../../42sh: cd: no such file or directory: symbolic_link1 + +---------------------------------------------------------------- + +minishell/builtins/env/005-set-variables (FAILED) + + Description: + The purpose of this test is to check that the builtin `env` can modify or set multiple environment variables before executing the given command. + + Before test: + 01: export VARTEST1="OLD_VALUE" + + STDIN: + 01: env VARTEST1=TOKEN201703241735_1 VARTEST2=TOKEN201703241735_2 VARTEST3=TOKEN201703241735_3 ./display_env + + STDOUT: + FAILURE expected_to match_regex `VARTEST1=TOKEN201703241735_1` + FAILURE expected_to match_regex `VARTEST2=TOKEN201703241735_2` + FAILURE expected_to match_regex `VARTEST3=TOKEN201703241735_3` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ../../42sh: env: VARTEST1=TOKEN201703241735_1: No such file or directory + +---------------------------------------------------------------- + +minishell/builtins/env/errors/001-command-not-found (FAILED) + + Description: + The purpose of this test is to check that using the builtin `env` with an invalid binary as argument results in an error and failure exit status. + + Before test: + 01: rm -f "./invalid_binary" + + STDIN: + 01: env ./invalid_binary + + STDOUT: + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `[Cc]ommand not found` + 01: ../../42sh: env: ./invalid_binary: No such file or directory + + MISC: + FAILURE expected_to_not exit_with_status `0` + +---------------------------------------------------------------- + +minishell/builtins/env/errors/002-illegal-option (FAILED) + + Description: + The purpose of this test is to check that using the builtin `env` with an invalid option results in an error and failure exit status. + + Before test: + 01: rm -f -- "-w" + + STDIN: + 01: env -w + + STDOUT: + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + SUCCESS might match_regex `([Ii]nvalid|[Ii]llegal) (option|argument)` + 01: env: invalid option -w + 02: ../../42sh: usage: env [-i] [name=value]... [utility [argument...]] + + MISC: + FAILURE expected_to_not exit_with_status `0` + +---------------------------------------------------------------- + +minishell/builtins/exit/errors/001-too-many-args (FAILED) + + Description: + The purpose of this test is to check that using a wrong number of arguments with the builtin `exit` does not result in the Shell termination but an error on standard error. + + STDIN: + 01: exit 21 42 + 02: ./write_on_stdout TOKEN201703241735 + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703241735` + (no output) + + STDERR: + FAILURE expected_to_not be_empty + WARNING might match_regex `([Tt]oo many arguments|[Aa]rgument list too long)` + (no output) + + MISC: + FAILURE expected_to exit_with_status `0` + +---------------------------------------------------------------- + +minishell/builtins/exit/errors/002-non-numeric-argument (FAILED) + + Description: + The purpose of this test is to check that using a non-numeric argument with the builtin `exit` results in the Shell termination and an error on standard error. + + STDIN: + 01: exit abc + 02: ./write_on_stdout TOKEN201703241735 + + STDOUT: + SUCCESS expected_to_not match_regex `TOKEN201703241735` + (no output) + + STDERR: + SUCCESS might_not be_empty + SUCCESS might match_regex `[Nn]umeric argument required` + 01: ../../42sh: exit: numeric argument required + + MISC: + FAILURE expected_to_not exit_with_status `0` + +---------------------------------------------------------------- + +minishell/builtins/mixed/001-setenv-unsetenv (FAILED) + + Description: + The purpose of this test is to check that setting and unsetting environment variable with the builtins `setenv` and `unsetenv` (or `export` and `unset`) works together. + + Before test: + 01: # unset all environment variables + 02: for VARIABLE in $(env | awk 'BEGIN {FS="="} {print $1}'); do unset "${VARIABLE}"; done; + + STDIN: + 01: setenv TEST1 + 02: setenv TEST2 + 03: unsetenv TEST1 + 04: unsetenv TEST2 + 05: ./display_env + 06: + 07: export TEST1 + 08: export TEST2 + 09: unset TEST1 + 10: unset TEST2 + 11: ./display_env + + STDOUT: + FAILURE expected_to_not match_regex `TEST1=` + FAILURE expected_to_not match_regex `TEST2=` + 01: ------------------------------ + 02: _=../../42sh + 03: ?=0 + 04: SHLVL=1 + 05: TEST1= + 06: TEST2= + 07: ------------------------------ + 08: TOTAL ENVIRONMENT VARIABLES: 5 + 09: ------------------------------ + 10: _=../../42sh + 11: ?=0 + 12: SHLVL=1 + 13: TEST1= + 14: TEST2= + 15: ------------------------------ + 16: TOTAL ENVIRONMENT VARIABLES: 5 + + STDERR: + (no output) + +---------------------------------------------------------------- + +minishell/builtins/setenv/004-invalid-identifier (WARNING) + + Description: + The purpose of this test is to check that using a wrong variable name with the builtin `setenv` (or `export`) results in error. + + STDIN: + 01: setenv 42 + 02: export 42 + + STDOUT: + SUCCESS might be_empty + (no output) + + STDERR: + SUCCESS expected_to_not be_empty + WARNING might match_regex `(not.*identifier|must begin.*letter)` + 01: ../../42sh: setenv: 42: invalid variable name + 02: ../../42sh: export: 42: invalid variable name + +---------------------------------------------------------------- + +minishell/builtins/unsetenv/001-unsetenv-first-elem (FAILED) + + Description: + This test was made to control if the Head of the env list was set correctly. + So we unset all the environment variables inside the tester environment and set a new one. + Thereafter we are unseting inside the tested shell. We are using env to check if the last head was remove correctly. + + Before test: + 01: # unset all environment variables + 02: for VARIABLE in $(env | awk 'BEGIN {FS="="} {print $1}'); do unset "${VARIABLE}"; done; + 03: + 04: export VARTEST="TOKEN201703241735" + + STDIN: + 01: unsetenv VARTEST + 02: unset VARTEST + 03: ./display_env + + STDOUT: + FAILURE expected_to_not match_regex `VARTEST=` + 01: ------------------------------ + 02: VARTEST=TOKEN201703241735 + 03: _=../../42sh + 04: ?=0 + 05: SHLVL=1 + 06: ------------------------------ + 07: TOTAL ENVIRONMENT VARIABLES: 4 + + STDERR: + (no output) + +---------------------------------------------------------------- + +minishell/builtins/unsetenv/002-unsetenv-mult-envp (FAILED) + + Description: + This test was made to check if we can unset multiple arguments. + So we unset all the environment variables inside the tester environment and set a 3 new variables. + Thereafter we are unseting all of them inside the tested shell. + + Before test: + 01: # unset all environment ariables + 02: for VARIABLE in $(env | awk 'BEGIN {FS="="} {print $1}'); do unset "${VARIABLE}"; done; + 03: + 04: export ONE="TOKEN201703241735_1" + 05: export TWO="TOKEN201703241735_2" + 06: export THREE="TOKEN201703241735_3" + + STDIN: + 01: unsetenv ONE + 02: unsetenv TWO + 03: unsetenv THREE + 04: unset ONE + 05: unset TWO + 06: unset THREE + 07: ./display_env + + STDOUT: + SUCCESS expected_to_not match_regex `ONE=` + SUCCESS expected_to_not match_regex `TWO=` + FAILURE expected_to_not match_regex `THREE=` + 01: ------------------------------ + 02: THREE=TOKEN201703241735_3 + 03: _=../../42sh + 04: ?=0 + 05: SHLVL=1 + 06: ------------------------------ + 07: TOTAL ENVIRONMENT VARIABLES: 4 + + STDERR: + (no output) + +---------------------------------------------------------------- + +minishell/builtins/unsetenv/003-unsetenv-mult-envp-inline (FAILED) + + Description: + This test was made to check if we can unset multiple arguments INLINE. + So we unset all the environment variables inside the tester environment and set a 3 new variables. + Thereafter we are unseting all of them INLINE inside the tested shell. + + Before test: + 01: # unset all variables + 02: for VARIABLE in $(env | awk 'BEGIN {FS="="} {print $1}'); do unset "${VARIABLE}"; done; + 03: + 04: export ONE="TOKEN201703241735_1" + 05: export TWO="TOKEN201703241735_2" + 06: export THREE="TOKEN201703241735_3" + + STDIN: + 01: unsetenv ONE TWO THREE + 02: unset ONE TWO THREE + 03: ./display_env + + STDOUT: + SUCCESS expected_to_not match_regex `ONE=` + FAILURE expected_to_not match_regex `TWO=` + FAILURE expected_to_not match_regex `THREE=` + 01: ------------------------------ + 02: THREE=TOKEN201703241735_3 + 03: TWO=TOKEN201703241735_2 + 04: _=../../42sh + 05: ?=0 + 06: SHLVL=1 + 07: ------------------------------ + 08: TOTAL ENVIRONMENT VARIABLES: 5 + + STDERR: + (no output) + +Total tests: 54 +Total failed tests: 12 +Total pending tests: 0 diff --git a/42sh/sample/assignement/var_01.sh b/42sh/sample/var_01.sh similarity index 100% rename from 42sh/sample/assignement/var_01.sh rename to 42sh/sample/var_01.sh diff --git a/42sh/shellscript/README.md b/42sh/shellscript/README.md deleted file mode 100644 index e6104108..00000000 --- a/42sh/shellscript/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# shellscript - -*[spec > 42sh](..) > shellscript* - -* [if](./if) -* [until](./until) -* [while](./while) diff --git a/42sh/shellscript/if/001-simple-if-1/README.md b/42sh/shellscript/if/001-simple-if-1/README.md deleted file mode 100644 index da1d0d91..00000000 --- a/42sh/shellscript/if/001-simple-if-1/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# 001-simple-if-1 - -*[spec > 42sh > shellscript > if](..) > 001-simple-if-1* - -The purpose of this test is to check that a if control flow does result in the execution of the compound list inside the correct branch -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -elif [ 1 ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -else - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" -expected_to_not match_regex ${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/if/001-simple-if-1/before_exec b/42sh/shellscript/if/001-simple-if-1/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/if/001-simple-if-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/if/001-simple-if-1/description b/42sh/shellscript/if/001-simple-if-1/description deleted file mode 100644 index 49870676..00000000 --- a/42sh/shellscript/if/001-simple-if-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a if control flow does result in the execution of the compound list inside the correct branch diff --git a/42sh/shellscript/if/001-simple-if-1/stdin b/42sh/shellscript/if/001-simple-if-1/stdin deleted file mode 100644 index 9b6c94f0..00000000 --- a/42sh/shellscript/if/001-simple-if-1/stdin +++ /dev/null @@ -1,10 +0,0 @@ -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -elif [ -f ${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -else - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi diff --git a/42sh/shellscript/if/001-simple-if-1/stdout b/42sh/shellscript/if/001-simple-if-1/stdout deleted file mode 100644 index b87145c9..00000000 --- a/42sh/shellscript/if/001-simple-if-1/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" -expected_to_not match_regex "${GLOBAL_TOKEN}_error" diff --git a/42sh/shellscript/if/002-simple-if-2/README.md b/42sh/shellscript/if/002-simple-if-2/README.md deleted file mode 100644 index d534e99c..00000000 --- a/42sh/shellscript/if/002-simple-if-2/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# 002-simple-if-2 - -*[spec > 42sh > shellscript > if](..) > 002-simple-if-2* - -The purpose of this test is to check that a if control flow does result in one execution of the compound list with a pipe inside -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -if [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -elif [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout | ./read_stdin -elif [ -f ${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error - ./delete-file ${GLOBAL_TOKEN}_FILE -else - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout@$" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/if/002-simple-if-2/before_exec b/42sh/shellscript/if/002-simple-if-2/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/if/002-simple-if-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/if/002-simple-if-2/description b/42sh/shellscript/if/002-simple-if-2/description deleted file mode 100644 index d03edcdc..00000000 --- a/42sh/shellscript/if/002-simple-if-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a if control flow does result in one execution of the compound list with a pipe inside diff --git a/42sh/shellscript/if/002-simple-if-2/stdin b/42sh/shellscript/if/002-simple-if-2/stdin deleted file mode 100644 index 556b0691..00000000 --- a/42sh/shellscript/if/002-simple-if-2/stdin +++ /dev/null @@ -1,13 +0,0 @@ -if [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -elif [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -elif [ -f ${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | ./read_on_stdin - ./delete-file ${GLOBAL_TOKEN}_FILE -else - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi diff --git a/42sh/shellscript/if/002-simple-if-2/stdout b/42sh/shellscript/if/002-simple-if-2/stdout deleted file mode 100644 index 1b2556ce..00000000 --- a/42sh/shellscript/if/002-simple-if-2/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" -expected_to_not match_regex "${GLOBAL_TOKEN}_error" diff --git a/42sh/shellscript/if/003-simple-if-3/README.md b/42sh/shellscript/if/003-simple-if-3/README.md deleted file mode 100644 index 3cf53f42..00000000 --- a/42sh/shellscript/if/003-simple-if-3/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# 003-simple-if-3 - -*[spec > 42sh > shellscript > if](..) > 003-simple-if-3* - -The purpose of this test is to check that a if control flow does result in one execution of the compound list with a redirection inside -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -if [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error > ${GLOBAL_TOKEN}_file -elif [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error > ${GLOBAL_TOKEN}_file -else - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_file -fi - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to create_file "${GLOBAL_TOKEN}_file" matching_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/if/003-simple-if-3/before_exec b/42sh/shellscript/if/003-simple-if-3/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/if/003-simple-if-3/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/if/003-simple-if-3/description b/42sh/shellscript/if/003-simple-if-3/description deleted file mode 100644 index 37a554c0..00000000 --- a/42sh/shellscript/if/003-simple-if-3/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a if control flow does result in one execution of the compound list with a redirection inside diff --git a/42sh/shellscript/if/003-simple-if-3/misc b/42sh/shellscript/if/003-simple-if-3/misc deleted file mode 100644 index cd59b9ee..00000000 --- a/42sh/shellscript/if/003-simple-if-3/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to create_file "${GLOBAL_TOKEN}_file" matching_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/if/003-simple-if-3/stdin b/42sh/shellscript/if/003-simple-if-3/stdin deleted file mode 100644 index eaae75e4..00000000 --- a/42sh/shellscript/if/003-simple-if-3/stdin +++ /dev/null @@ -1,9 +0,0 @@ -if [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error > ${GLOBAL_TOKEN}_file -elif [ -f no_${GLOBAL_TOKEN}_FILE ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error > ${GLOBAL_TOKEN}_file -else - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_file -fi diff --git a/42sh/shellscript/if/003-simple-if-3/stdout b/42sh/shellscript/if/003-simple-if-3/stdout deleted file mode 100644 index edd840fd..00000000 --- a/42sh/shellscript/if/003-simple-if-3/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/if/004-nested-if/README.md b/42sh/shellscript/if/004-nested-if/README.md deleted file mode 100644 index 75b3281e..00000000 --- a/42sh/shellscript/if/004-nested-if/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# 004-nested-if - -*[spec > 42sh > shellscript > if](..) > 004-nested-if* - -The purpose of this test is to check that a if control flow nested in a if control flow does result in one execution of the compound list -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE - elif [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_error - fi -elif [ 1 ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" -expected_to_not match_regex "${GLOBAL_TOKEN}_error" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/if/004-nested-if/before_exec b/42sh/shellscript/if/004-nested-if/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/if/004-nested-if/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/if/004-nested-if/description b/42sh/shellscript/if/004-nested-if/description deleted file mode 100644 index 7fa79164..00000000 --- a/42sh/shellscript/if/004-nested-if/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a if control flow nested in a if control flow does result in one execution of the compound list diff --git a/42sh/shellscript/if/004-nested-if/stdin b/42sh/shellscript/if/004-nested-if/stdin deleted file mode 100644 index f16940ab..00000000 --- a/42sh/shellscript/if/004-nested-if/stdin +++ /dev/null @@ -1,14 +0,0 @@ -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE - elif [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_error - fi -elif [ 1 ] -then - ./write_on_stdout ${GLOBAL_TOKEN}_error -fi diff --git a/42sh/shellscript/if/004-nested-if/stdout b/42sh/shellscript/if/004-nested-if/stdout deleted file mode 100644 index b87145c9..00000000 --- a/42sh/shellscript/if/004-nested-if/stdout +++ /dev/null @@ -1,2 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" -expected_to_not match_regex "${GLOBAL_TOKEN}_error" diff --git a/42sh/shellscript/if/005-hard-nested-if/README.md b/42sh/shellscript/if/005-hard-nested-if/README.md deleted file mode 100644 index 2908a8f1..00000000 --- a/42sh/shellscript/if/005-hard-nested-if/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# 005-hard-nested-if - -*[spec > 42sh > shellscript > if](..) > 005-hard-nested-if* - -The purpose of this test is to check that multiple if control flow nested in a if does result in one execution of the compound list for each deeper if -### Shell commands that are sent to the standard entry - -```bash -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - fi - fi - fi - fi - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - fi - fi - fi - fi - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./delete-file ${GLOBAL_TOKEN}_FILE - fi - fi - fi - fi -fi - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/if/005-hard-nested-if/before_exec b/42sh/shellscript/if/005-hard-nested-if/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/if/005-hard-nested-if/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/if/005-hard-nested-if/description b/42sh/shellscript/if/005-hard-nested-if/description deleted file mode 100644 index 38eeaa8c..00000000 --- a/42sh/shellscript/if/005-hard-nested-if/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that multiple if control flow nested in a if does result in one execution of the compound list for each deeper if diff --git a/42sh/shellscript/if/005-hard-nested-if/stdin b/42sh/shellscript/if/005-hard-nested-if/stdin deleted file mode 100644 index b12fa193..00000000 --- a/42sh/shellscript/if/005-hard-nested-if/stdin +++ /dev/null @@ -1,43 +0,0 @@ -if [ -f ${GLOBAL_TOKEN}_FILE ] -then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - fi - fi - fi - fi - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - fi - fi - fi - fi - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - if [ -f ${GLOBAL_TOKEN}_FILE ] - then - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./delete-file ${GLOBAL_TOKEN}_FILE - fi - fi - fi - fi -fi diff --git a/42sh/shellscript/if/005-hard-nested-if/stdout b/42sh/shellscript/if/005-hard-nested-if/stdout deleted file mode 100644 index 3a17c16f..00000000 --- a/42sh/shellscript/if/005-hard-nested-if/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" diff --git a/42sh/shellscript/if/README.md b/42sh/shellscript/if/README.md deleted file mode 100644 index 12f96d9c..00000000 --- a/42sh/shellscript/if/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# if - -*[spec > 42sh > shellscript](..) > if* - -* [001-simple-if-1](./001-simple-if-1) -* [002-simple-if-2](./002-simple-if-2) -* [003-simple-if-3](./003-simple-if-3) -* [004-nested-if](./004-nested-if) -* [005-hard-nested-if](./005-hard-nested-if) diff --git a/42sh/shellscript/test b/42sh/shellscript/test deleted file mode 100644 index 5dcac487..00000000 --- a/42sh/shellscript/test +++ /dev/null @@ -1,20 +0,0 @@ -10 lignes de cmd inside -cmd | control flow -control flow > redir -control flow in condition control flow -control flow && cmd -control flow || cmd -add for -add case -add func func dans func = 10 -add math = 20 -add var = 10 -add brace = 20 -add commentaires = 2-3 -add tk_bang = 5 - -mixed one for each condition and block - -add 3 script - -100 tests + 50 tests diff --git a/42sh/shellscript/until/001-simple-until-1/README.md b/42sh/shellscript/until/001-simple-until-1/README.md deleted file mode 100644 index 2fe104a8..00000000 --- a/42sh/shellscript/until/001-simple-until-1/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# 001-simple-until-1 - -*[spec > 42sh > shellscript > until](..) > 001-simple-until-1* - -The purpose of this test is to check that a until control flow does result in one execution of the compound list. -### Shell commands that are sent to the standard entry - -```bash -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./create-file ${GLOBAL_TOKEN} -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/until/001-simple-until-1/before_exec b/42sh/shellscript/until/001-simple-until-1/before_exec deleted file mode 100644 index d86c9fb5..00000000 --- a/42sh/shellscript/until/001-simple-until-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -./delete-file ${GLOBAL_TOKEN}_FILE diff --git a/42sh/shellscript/until/001-simple-until-1/description b/42sh/shellscript/until/001-simple-until-1/description deleted file mode 100644 index af129611..00000000 --- a/42sh/shellscript/until/001-simple-until-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a until control flow does result in one execution of the compound list. diff --git a/42sh/shellscript/until/001-simple-until-1/stdin b/42sh/shellscript/until/001-simple-until-1/stdin deleted file mode 100644 index d6e21471..00000000 --- a/42sh/shellscript/until/001-simple-until-1/stdin +++ /dev/null @@ -1,5 +0,0 @@ -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./create-file ${GLOBAL_TOKEN} -done diff --git a/42sh/shellscript/until/001-simple-until-1/stdout b/42sh/shellscript/until/001-simple-until-1/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/until/001-simple-until-1/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/until/002-simple-until-2/README.md b/42sh/shellscript/until/002-simple-until-2/README.md deleted file mode 100644 index c2312de7..00000000 --- a/42sh/shellscript/until/002-simple-until-2/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# 002-simple-until-2 - -*[spec > 42sh > shellscript > until](..) > 002-simple-until-2* - -The purpose of this test is to check that a until control flow does result in one execution of the compound list with a pipe inside -### Shell commands that are sent to the standard entry - -```bash -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout | ./read_on_stdin - ./create-file ${GLOBAL_TOKEN} -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/until/002-simple-until-2/before_exec b/42sh/shellscript/until/002-simple-until-2/before_exec deleted file mode 100644 index d86c9fb5..00000000 --- a/42sh/shellscript/until/002-simple-until-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -./delete-file ${GLOBAL_TOKEN}_FILE diff --git a/42sh/shellscript/until/002-simple-until-2/description b/42sh/shellscript/until/002-simple-until-2/description deleted file mode 100644 index d11b3c23..00000000 --- a/42sh/shellscript/until/002-simple-until-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a until control flow does result in one execution of the compound list with a pipe inside diff --git a/42sh/shellscript/until/002-simple-until-2/stdin b/42sh/shellscript/until/002-simple-until-2/stdin deleted file mode 100644 index 68b9bb19..00000000 --- a/42sh/shellscript/until/002-simple-until-2/stdin +++ /dev/null @@ -1,6 +0,0 @@ -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - echo "HELLO" - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | ./read_on_stdin - ./create-file ${GLOBAL_TOKEN} -done diff --git a/42sh/shellscript/until/002-simple-until-2/stdout b/42sh/shellscript/until/002-simple-until-2/stdout deleted file mode 100644 index cd9c01ce..00000000 --- a/42sh/shellscript/until/002-simple-until-2/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" diff --git a/42sh/shellscript/until/003-simple-until-3/README.md b/42sh/shellscript/until/003-simple-until-3/README.md deleted file mode 100644 index 185aae52..00000000 --- a/42sh/shellscript/until/003-simple-until-3/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 003-simple-until-3 - -*[spec > 42sh > shellscript > until](..) > 003-simple-until-3* - -The purpose of this test is to check that a until control flow does result in one execution of the compound list with a redirection inside -### Shell commands that are sent to the standard entry - -```bash -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_file - ./create-file ${GLOBAL_TOKEN} -done - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to create_file "${GLOBAL_TOKEN}_file" matching_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/until/003-simple-until-3/before_exec b/42sh/shellscript/until/003-simple-until-3/before_exec deleted file mode 100644 index d86c9fb5..00000000 --- a/42sh/shellscript/until/003-simple-until-3/before_exec +++ /dev/null @@ -1 +0,0 @@ -./delete-file ${GLOBAL_TOKEN}_FILE diff --git a/42sh/shellscript/until/003-simple-until-3/description b/42sh/shellscript/until/003-simple-until-3/description deleted file mode 100644 index b8f19ad8..00000000 --- a/42sh/shellscript/until/003-simple-until-3/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a until control flow does result in one execution of the compound list with a redirection inside diff --git a/42sh/shellscript/until/003-simple-until-3/misc b/42sh/shellscript/until/003-simple-until-3/misc deleted file mode 100644 index 2c398ba6..00000000 --- a/42sh/shellscript/until/003-simple-until-3/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to create_file "${GLOBAL_TOKEN}_OUTPUT" matching_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/until/003-simple-until-3/stdin b/42sh/shellscript/until/003-simple-until-3/stdin deleted file mode 100644 index 5b8f6cbd..00000000 --- a/42sh/shellscript/until/003-simple-until-3/stdin +++ /dev/null @@ -1,5 +0,0 @@ -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_OUTPUT - ./create-file ${GLOBAL_TOKEN} -done diff --git a/42sh/shellscript/until/003-simple-until-3/stdout b/42sh/shellscript/until/003-simple-until-3/stdout deleted file mode 100644 index edd840fd..00000000 --- a/42sh/shellscript/until/003-simple-until-3/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/until/004-nested-until/README.md b/42sh/shellscript/until/004-nested-until/README.md deleted file mode 100644 index 2552d959..00000000 --- a/42sh/shellscript/until/004-nested-until/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# 004-nested-until - -*[spec > 42sh > shellscript > until](..) > 004-nested-until* - -The purpose of this test is to check that a until control flow nested in a until control flow does result in one execution of the compound list -### Shell commands that are sent to the standard entry - -```bash -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./create-file ${GLOBAL_TOKEN} - done -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/until/004-nested-until/before_exec b/42sh/shellscript/until/004-nested-until/before_exec deleted file mode 100644 index d86c9fb5..00000000 --- a/42sh/shellscript/until/004-nested-until/before_exec +++ /dev/null @@ -1 +0,0 @@ -./delete-file ${GLOBAL_TOKEN}_FILE diff --git a/42sh/shellscript/until/004-nested-until/description b/42sh/shellscript/until/004-nested-until/description deleted file mode 100644 index d5f23016..00000000 --- a/42sh/shellscript/until/004-nested-until/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a until control flow nested in a until control flow does result in one execution of the compound list diff --git a/42sh/shellscript/until/004-nested-until/stdin b/42sh/shellscript/until/004-nested-until/stdin deleted file mode 100644 index 376d6195..00000000 --- a/42sh/shellscript/until/004-nested-until/stdin +++ /dev/null @@ -1,8 +0,0 @@ -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./create-file ${GLOBAL_TOKEN} - done -done diff --git a/42sh/shellscript/until/004-nested-until/stdout b/42sh/shellscript/until/004-nested-until/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/until/004-nested-until/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/until/005-hard-nested-until/README.md b/42sh/shellscript/until/005-hard-nested-until/README.md deleted file mode 100644 index 3930dc89..00000000 --- a/42sh/shellscript/until/005-hard-nested-until/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# 005-hard-nested-until - -*[spec > 42sh > shellscript > until](..) > 005-hard-nested-until* - -The purpose of this test is to check that multiple until control flow nested in a until does result in one execution of the compound list for each deeper until -### Shell commands that are sent to the standard entry - -```bash -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done - ./delete-file ${GLOBAL_TOKEN}_FILE - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done - ./delete-file ${GLOBAL_TOKEN}_FILE - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/until/005-hard-nested-until/before_exec b/42sh/shellscript/until/005-hard-nested-until/before_exec deleted file mode 100644 index d86c9fb5..00000000 --- a/42sh/shellscript/until/005-hard-nested-until/before_exec +++ /dev/null @@ -1 +0,0 @@ -./delete-file ${GLOBAL_TOKEN}_FILE diff --git a/42sh/shellscript/until/005-hard-nested-until/description b/42sh/shellscript/until/005-hard-nested-until/description deleted file mode 100644 index 9e053e4f..00000000 --- a/42sh/shellscript/until/005-hard-nested-until/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that multiple until control flow nested in a until does result in one execution of the compound list for each deeper until diff --git a/42sh/shellscript/until/005-hard-nested-until/stdin b/42sh/shellscript/until/005-hard-nested-until/stdin deleted file mode 100644 index 52e18c68..00000000 --- a/42sh/shellscript/until/005-hard-nested-until/stdin +++ /dev/null @@ -1,47 +0,0 @@ -until [ -f ${GLOBAL_TOKEN}_FILE ] -do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done - ./delete-file ${GLOBAL_TOKEN}_FILE - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done - ./delete-file ${GLOBAL_TOKEN}_FILE - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - until [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./create-file ${GLOBAL_TOKEN} - done - done - done - done -done diff --git a/42sh/shellscript/until/005-hard-nested-until/stdout b/42sh/shellscript/until/005-hard-nested-until/stdout deleted file mode 100644 index 3a17c16f..00000000 --- a/42sh/shellscript/until/005-hard-nested-until/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" diff --git a/42sh/shellscript/until/README.md b/42sh/shellscript/until/README.md deleted file mode 100644 index 6641783e..00000000 --- a/42sh/shellscript/until/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# until - -*[spec > 42sh > shellscript](..) > until* - -* [001-simple-until-1](./001-simple-until-1) -* [002-simple-until-2](./002-simple-until-2) -* [003-simple-until-3](./003-simple-until-3) -* [004-nested-until](./004-nested-until) -* [005-hard-nested-until](./005-hard-nested-until) diff --git a/42sh/shellscript/while/001-simple-while-1/README.md b/42sh/shellscript/while/001-simple-while-1/README.md deleted file mode 100644 index 27a605af..00000000 --- a/42sh/shellscript/while/001-simple-while-1/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 001-simple-while-1 - -*[spec > 42sh > shellscript > while](..) > 001-simple-while-1* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list. -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/001-simple-while-1/before_exec b/42sh/shellscript/while/001-simple-while-1/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/001-simple-while-1/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/001-simple-while-1/description b/42sh/shellscript/while/001-simple-while-1/description deleted file mode 100644 index 5ea885ea..00000000 --- a/42sh/shellscript/while/001-simple-while-1/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a while control flow does result in one execution of the compound list. diff --git a/42sh/shellscript/while/001-simple-while-1/stdin b/42sh/shellscript/while/001-simple-while-1/stdin deleted file mode 100644 index b5c18790..00000000 --- a/42sh/shellscript/while/001-simple-while-1/stdin +++ /dev/null @@ -1,5 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/001-simple-while-1/stdout b/42sh/shellscript/while/001-simple-while-1/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/while/001-simple-while-1/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/002-simple-while-2/README.md b/42sh/shellscript/while/002-simple-while-2/README.md deleted file mode 100644 index e87cc6df..00000000 --- a/42sh/shellscript/while/002-simple-while-2/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 002-simple-while-2 - -*[spec > 42sh > shellscript > while](..) > 002-simple-while-2* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list with a pipe inside -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout | ./read_on_stdin - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/002-simple-while-2/before_exec b/42sh/shellscript/while/002-simple-while-2/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/002-simple-while-2/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/002-simple-while-2/description b/42sh/shellscript/while/002-simple-while-2/description deleted file mode 100644 index 7aae1a4a..00000000 --- a/42sh/shellscript/while/002-simple-while-2/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a while control flow does result in one execution of the compound list with a pipe inside diff --git a/42sh/shellscript/while/002-simple-while-2/stdin b/42sh/shellscript/while/002-simple-while-2/stdin deleted file mode 100644 index 805e803f..00000000 --- a/42sh/shellscript/while/002-simple-while-2/stdin +++ /dev/null @@ -1,5 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | ./read_on_stdin - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/002-simple-while-2/stdout b/42sh/shellscript/while/002-simple-while-2/stdout deleted file mode 100644 index cd9c01ce..00000000 --- a/42sh/shellscript/while/002-simple-while-2/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" diff --git a/42sh/shellscript/while/003-simple-while-3/README.md b/42sh/shellscript/while/003-simple-while-3/README.md deleted file mode 100644 index edce13c0..00000000 --- a/42sh/shellscript/while/003-simple-while-3/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# 003-simple-while-3 - -*[spec > 42sh > shellscript > while](..) > 003-simple-while-3* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list with a redirection inside -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_file - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### What miscellaneous behaviors are expected - -```bash -expected_to create_file "${GLOBAL_TOKEN}_file" matching_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/003-simple-while-3/before_exec b/42sh/shellscript/while/003-simple-while-3/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/003-simple-while-3/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/003-simple-while-3/description b/42sh/shellscript/while/003-simple-while-3/description deleted file mode 100644 index 1f284647..00000000 --- a/42sh/shellscript/while/003-simple-while-3/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a while control flow does result in one execution of the compound list with a redirection inside diff --git a/42sh/shellscript/while/003-simple-while-3/misc b/42sh/shellscript/while/003-simple-while-3/misc deleted file mode 100644 index 2c398ba6..00000000 --- a/42sh/shellscript/while/003-simple-while-3/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to create_file "${GLOBAL_TOKEN}_OUTPUT" matching_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/003-simple-while-3/stdin b/42sh/shellscript/while/003-simple-while-3/stdin deleted file mode 100644 index 20275496..00000000 --- a/42sh/shellscript/while/003-simple-while-3/stdin +++ /dev/null @@ -1,5 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout > ${GLOBAL_TOKEN}_OUTPUT - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/003-simple-while-3/stdout b/42sh/shellscript/while/003-simple-while-3/stdout deleted file mode 100644 index edd840fd..00000000 --- a/42sh/shellscript/while/003-simple-while-3/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/004-nested-while/README.md b/42sh/shellscript/while/004-nested-while/README.md deleted file mode 100644 index bd885f07..00000000 --- a/42sh/shellscript/while/004-nested-while/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# 004-nested-while - -*[spec > 42sh > shellscript > while](..) > 004-nested-while* - -The purpose of this test is to check that a while control flow nested in a while control flow does result in one execution of the compound list -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE - done -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/004-nested-while/before_exec b/42sh/shellscript/while/004-nested-while/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/004-nested-while/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/004-nested-while/description b/42sh/shellscript/while/004-nested-while/description deleted file mode 100644 index 77b8e1fb..00000000 --- a/42sh/shellscript/while/004-nested-while/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a while control flow nested in a while control flow does result in one execution of the compound list diff --git a/42sh/shellscript/while/004-nested-while/stdin b/42sh/shellscript/while/004-nested-while/stdin deleted file mode 100644 index be057971..00000000 --- a/42sh/shellscript/while/004-nested-while/stdin +++ /dev/null @@ -1,8 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE - done -done diff --git a/42sh/shellscript/while/004-nested-while/stdout b/42sh/shellscript/while/004-nested-while/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/while/004-nested-while/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/005-hard-nested-while/README.md b/42sh/shellscript/while/005-hard-nested-while/README.md deleted file mode 100644 index ee2ce86d..00000000 --- a/42sh/shellscript/while/005-hard-nested-while/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# 005-hard-nested-while - -*[spec > 42sh > shellscript > while](..) > 005-hard-nested-while* - -The purpose of this test is to check that multiple while control flow nested in a while does result in one execution of the compound list for each deeper while -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/005-hard-nested-while/before_exec b/42sh/shellscript/while/005-hard-nested-while/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/005-hard-nested-while/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/005-hard-nested-while/description b/42sh/shellscript/while/005-hard-nested-while/description deleted file mode 100644 index dc788b99..00000000 --- a/42sh/shellscript/while/005-hard-nested-while/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that multiple while control flow nested in a while does result in one execution of the compound list for each deeper while diff --git a/42sh/shellscript/while/005-hard-nested-while/stdin b/42sh/shellscript/while/005-hard-nested-while/stdin deleted file mode 100644 index 648b1c10..00000000 --- a/42sh/shellscript/while/005-hard-nested-while/stdin +++ /dev/null @@ -1,47 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done -done diff --git a/42sh/shellscript/while/005-hard-nested-while/stdout b/42sh/shellscript/while/005-hard-nested-while/stdout deleted file mode 100644 index 3a17c16f..00000000 --- a/42sh/shellscript/while/005-hard-nested-while/stdout +++ /dev/null @@ -1,3 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" diff --git a/42sh/shellscript/while/006-big-instruction-block/README.md b/42sh/shellscript/while/006-big-instruction-block/README.md deleted file mode 100644 index ee2ce86d..00000000 --- a/42sh/shellscript/while/006-big-instruction-block/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# 005-hard-nested-while - -*[spec > 42sh > shellscript > while](..) > 005-hard-nested-while* - -The purpose of this test is to check that multiple while control flow nested in a while does result in one execution of the compound list for each deeper while -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout1 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout2 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done - ./create-file ${GLOBAL_TOKEN} - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - while [ -f ${GLOBAL_TOKEN}_FILE ] - do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout3 - ./delete-file ${GLOBAL_TOKEN}_FILE - done - done - done - done -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout1" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/006-big-instruction-block/before_exec b/42sh/shellscript/while/006-big-instruction-block/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/006-big-instruction-block/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/006-big-instruction-block/description b/42sh/shellscript/while/006-big-instruction-block/description deleted file mode 100644 index d3e71ca3..00000000 --- a/42sh/shellscript/while/006-big-instruction-block/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a big execution block succeed diff --git a/42sh/shellscript/while/006-big-instruction-block/stdin b/42sh/shellscript/while/006-big-instruction-block/stdin deleted file mode 100644 index 7276286d..00000000 --- a/42sh/shellscript/while/006-big-instruction-block/stdin +++ /dev/null @@ -1,14 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout1 ${GLOBAL_TOKEN}_stderr1 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout2 ${GLOBAL_TOKEN}_stderr2 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout3 ${GLOBAL_TOKEN}_stderr3 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout4 ${GLOBAL_TOKEN}_stderr4 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout5 ${GLOBAL_TOKEN}_stderr5 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout6 ${GLOBAL_TOKEN}_stderr6 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout7 ${GLOBAL_TOKEN}_stderr7 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout8 ${GLOBAL_TOKEN}_stderr8 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout9 ${GLOBAL_TOKEN}_stderr9 | ./read_on_stdin - ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout10 ${GLOBAL_TOKEN}_stderr10 | ./read_on_stdin - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/006-big-instruction-block/stdout b/42sh/shellscript/while/006-big-instruction-block/stdout deleted file mode 100644 index c317dc13..00000000 --- a/42sh/shellscript/while/006-big-instruction-block/stdout +++ /dev/null @@ -1,10 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout1@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout2@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout3@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout4@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout5@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout6@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout7@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout8@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout9@$" -expected_to match_regex "${GLOBAL_TOKEN}_stdout10@$" diff --git a/42sh/shellscript/while/007-pipe-and-while/README.md b/42sh/shellscript/while/007-pipe-and-while/README.md deleted file mode 100644 index 27a605af..00000000 --- a/42sh/shellscript/while/007-pipe-and-while/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 001-simple-while-1 - -*[spec > 42sh > shellscript > while](..) > 001-simple-while-1* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list. -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/007-pipe-and-while/before_exec b/42sh/shellscript/while/007-pipe-and-while/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/007-pipe-and-while/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/007-pipe-and-while/description b/42sh/shellscript/while/007-pipe-and-while/description deleted file mode 100644 index a7f8bcd5..00000000 --- a/42sh/shellscript/while/007-pipe-and-while/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a command could be piped inside a while diff --git a/42sh/shellscript/while/007-pipe-and-while/stdin b/42sh/shellscript/while/007-pipe-and-while/stdin deleted file mode 100644 index dd50a616..00000000 --- a/42sh/shellscript/while/007-pipe-and-while/stdin +++ /dev/null @@ -1,5 +0,0 @@ -./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./read_on_stdin_once - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/007-pipe-and-while/stdout b/42sh/shellscript/while/007-pipe-and-while/stdout deleted file mode 100644 index cd9c01ce..00000000 --- a/42sh/shellscript/while/007-pipe-and-while/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" diff --git a/42sh/shellscript/while/008-redir-and-while/README.md b/42sh/shellscript/while/008-redir-and-while/README.md deleted file mode 100644 index 27a605af..00000000 --- a/42sh/shellscript/while/008-redir-and-while/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 001-simple-while-1 - -*[spec > 42sh > shellscript > while](..) > 001-simple-while-1* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list. -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/008-redir-and-while/before_exec b/42sh/shellscript/while/008-redir-and-while/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/008-redir-and-while/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/008-redir-and-while/description b/42sh/shellscript/while/008-redir-and-while/description deleted file mode 100644 index 80d7f5be..00000000 --- a/42sh/shellscript/while/008-redir-and-while/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a redirection after the while output the result in a file diff --git a/42sh/shellscript/while/008-redir-and-while/misc b/42sh/shellscript/while/008-redir-and-while/misc deleted file mode 100644 index 2c398ba6..00000000 --- a/42sh/shellscript/while/008-redir-and-while/misc +++ /dev/null @@ -1 +0,0 @@ -expected_to create_file "${GLOBAL_TOKEN}_OUTPUT" matching_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/008-redir-and-while/stdin b/42sh/shellscript/while/008-redir-and-while/stdin deleted file mode 100644 index 68f3fafb..00000000 --- a/42sh/shellscript/while/008-redir-and-while/stdin +++ /dev/null @@ -1,5 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done > ${GLOBAL_TOKEN}_OUTPUT diff --git a/42sh/shellscript/while/008-redir-and-while/stdout b/42sh/shellscript/while/008-redir-and-while/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/while/008-redir-and-while/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/009-nested-while-in-condition/README.md b/42sh/shellscript/while/009-nested-while-in-condition/README.md deleted file mode 100644 index 27a605af..00000000 --- a/42sh/shellscript/while/009-nested-while-in-condition/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 001-simple-while-1 - -*[spec > 42sh > shellscript > while](..) > 001-simple-while-1* - -The purpose of this test is to check that a while control flow does result in one execution of the compound list. -### What is done before test - -```bash -./create-file ${GLOBAL_TOKEN} - -``` - -### Shell commands that are sent to the standard entry - -```bash -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done - -``` - -### What is expected on standard output - -```bash -expected_to match_regex "${GLOBAL_TOKEN}_stdout" - -``` - -### Variables - -The following variables may appear in this test: - -* ${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester -* ${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed -* ${**GLOBAL_TOKEN**} -> A token that changes value at launch time -* ${**PATH**} -> The standard environment variable PATH -* ${**HOME**} -> The standard environment variable HOME - -### Support binaries - -The following binaries may appear in this test: - - -* **[./create_file](http://github.com/we-sh/42ShellTester/tree/master/support/create-file)** -> A binary that creates file named argv[1] + "_FILE" If argv[1] is not set, the file is named "TOKEN_FILE" -* **[./delete_file](http://github.com/we-sh/42ShellTester/tree/master/support/delete-file)** -> A binary that delete all files called in argument. -* **[./display_env](http://github.com/we-sh/42ShellTester/tree/master/support/display-env)** -> A binary that iterates on `**envp` and write each element on standard output. -* **[./display_program_name](http://github.com/we-sh/42ShellTester/tree/master/support/display-program-name)** -> A binary that writes its name on standard ouput. -* **[./display_pwd](http://github.com/we-sh/42ShellTester/tree/master/support/display-pwd)** -> A binary that writes on standard output the absolute path of the current directory returned by `getcwd(3)`, encountered with the strings `PWD:` and `:PWD`. -* **[./exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/exit-with-status)** -> A binary that immediately exits with the status given as first argument. -* **[./read_on_stdin](http://github.com/we-sh/42ShellTester/tree/master/support/read-on-stdin)** -> A binary that reads on standard entry and write each line on standard output suffixed with the character `@` (e.g. same behavior as `cat -e` and the *newline* character). When `read(2)` returns `-1`, then the string `STDIN READ ERROR` is written on standard error. -* **[./sleep_and_exit_with_status](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-exit-with-status)** -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. -* **[./sleep_and_write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/sleep-and-write-on-stderr)** -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL. -* **[./write_all_arguments_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-all-arguments-on-stdout)** -> A binary that writes on standard output each argument separated by the symbol `@`. If no argument is given, it writes the string "nothing to be written on stdout". -* **[./write_on_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stderr)** -> A binary that writes on standard error the first given argument (the same behavior as `echo` but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status `1`. -* **[./write_on_stdout](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout)** -> A binary that writes on standard output the first given argument (the same behavior as `echo` but with only one argument). If no argument is given, it writes the string "write on stdout". -* **[./write_on_stdout_and_stderr](http://github.com/we-sh/42ShellTester/tree/master/support/write-on-stdout-and-stderr)** -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr". diff --git a/42sh/shellscript/while/009-nested-while-in-condition/before_exec b/42sh/shellscript/while/009-nested-while-in-condition/before_exec deleted file mode 100644 index 5e44f185..00000000 --- a/42sh/shellscript/while/009-nested-while-in-condition/before_exec +++ /dev/null @@ -1 +0,0 @@ -./create-file ${GLOBAL_TOKEN} diff --git a/42sh/shellscript/while/009-nested-while-in-condition/description b/42sh/shellscript/while/009-nested-while-in-condition/description deleted file mode 100644 index 5ea885ea..00000000 --- a/42sh/shellscript/while/009-nested-while-in-condition/description +++ /dev/null @@ -1 +0,0 @@ -The purpose of this test is to check that a while control flow does result in one execution of the compound list. diff --git a/42sh/shellscript/while/009-nested-while-in-condition/stdin b/42sh/shellscript/while/009-nested-while-in-condition/stdin deleted file mode 100644 index b5c18790..00000000 --- a/42sh/shellscript/while/009-nested-while-in-condition/stdin +++ /dev/null @@ -1,5 +0,0 @@ -while [ -f ${GLOBAL_TOKEN}_FILE ] -do - ./write_on_stdout ${GLOBAL_TOKEN}_stdout - ./delete-file ${GLOBAL_TOKEN}_FILE -done diff --git a/42sh/shellscript/while/009-nested-while-in-condition/stdout b/42sh/shellscript/while/009-nested-while-in-condition/stdout deleted file mode 100644 index cf61bc5f..00000000 --- a/42sh/shellscript/while/009-nested-while-in-condition/stdout +++ /dev/null @@ -1 +0,0 @@ -expected_to match_regex "${GLOBAL_TOKEN}_stdout" diff --git a/42sh/shellscript/while/README.md b/42sh/shellscript/while/README.md deleted file mode 100644 index b724a861..00000000 --- a/42sh/shellscript/while/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# while - -*[spec > 42sh > shellscript](..) > while* - -* [001-simple-while-1](./001-simple-while-1) -* [002-simple-while-2](./002-simple-while-2) -* [003-simple-while-3](./003-simple-while-3) -* [004-nested-while](./004-nested-while) -* [005-hard-nested-while](./005-hard-nested-while) diff --git a/42sh/test_framework.sh b/42sh/test_framework.sh deleted file mode 100755 index eb97fe43..00000000 --- a/42sh/test_framework.sh +++ /dev/null @@ -1,41 +0,0 @@ -SHELL=$1 -TOTAL_TEST=0 -NBR_TEST_SUCCESS=0 -unset LIST_TEST -LIST_TEST='./TESTSHELL/*'/'*'.test -DIR_TEST=./TESTSHELL - -do_test() { - -for TEST in $LIST_TEST -do - - ($SHELL < $TEST 1> ${DIR_TEST}/stdin_test 2> ${DIR_TEST}/stderr_test) - (bash < $TEST 1> ${DIR_TEST}/stdin_ref 2> ${DIR_TEST}/stderr_ref) - - if ! diff ${DIR_TEST}/stdin_test ${DIR_TEST}/stdin_ref > /dev/null || - ! diff ${DIR_TEST}/stderr_test ${DIR_TEST}/stderr_test > /dev/null - then - echo "\033[0;31mFAILURE $TEST" >> ${DIR_TEST}/resultat - else - ((NBR_TEST_SUCCESS++)) - fi - ((TOTAL_TEST++)) -done -} - -do_test - -if [ -e ${DIR_TEST}/resultat ] -then - cat ${DIR_TEST}/resultat -fi -echo "\033[0;32mYou succeed $NBR_TEST_SUCCESS tests on $TOTAL_TEST" - -rm -f $DIR_TEST/resultat - -#add random input sed -n $RANDOM "p" /usr/share/dict/words -#add timeout -#charging phase of test -#real verification of references -#to add extranous comportement