diff --git a/42sh/21sh_error b/42sh/21sh_error deleted file mode 100644 index 4e43d0d5..00000000 --- a/42sh/21sh_error +++ /dev/null @@ -1,235 +0,0 @@ -.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/42ShellTester/.gitignore b/42sh/42ShellTester/.gitignore deleted file mode 100644 index 28f63f2b..00000000 --- a/42sh/42ShellTester/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -tmp/ -.mshell_hist -.DS_Store diff --git a/42sh/42ShellTester/42ShellTester.sh b/42sh/42ShellTester/42ShellTester.sh deleted file mode 100644 index 8bb3198b..00000000 --- a/42sh/42ShellTester/42ShellTester.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash - -# /* -# Launcher -# */ - -get_install_directory() -{ - local SOURCE="${BASH_SOURCE[0]}" - local DIR - while [ -h "${SOURCE}" ] - do - DIR="$(cd -P "$(dirname "${SOURCE}")" && pwd)" - SOURCE="$(readlink "${SOURCE}")" - [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - printf "%s" "$(cd -P "$(dirname "${SOURCE}")" && pwd)" -} - -# global variables -GLOBAL_PROG="" -GLOBAL_PROG_REFERENCE="" -GLOBAL_SPECS_FILTER="" -GLOBAL_ENTRYPATH=$(pwd) -GLOBAL_INSTALLDIR="$(get_install_directory)" -GLOBAL_TMP_DIRECTORY="${GLOBAL_INSTALLDIR}/tmp" -GLOBAL_LOCALBRANCH=$(git branch | awk '$0 ~ /^\*/ {print $2; exit}') -GLOBAL_TOKEN="TOKEN$(date +%Y%m%d%H%M)" -GLOBAL_TOTAL_TESTS=0 -GLOBAL_TOTAL_FAILED_TESTS=0 -GLOBAL_TOTAL_PENDING_TESTS=0 -GLOBAL_LOG="" -GLOBAL_SHOW_SUCCESS=0 -GLOBAL_RUN_POSIX_ONLY=0 -GLOBAL_RUN_PENDING_TESTS=0 -GLOBAL_RUN_HARD_TESTS=0 -GLOBAL_RUN_ALL_TESTS=0 -GLOBAL_INVALID_OPTION=0 -C_BOLD="\033[37;1m" -C_RED="\033[31m\033[38;5;160m" -C_GREEN="\033[31m\033[38;5;34m" -C_YELLOW="\033[31m\033[1;33m" -C_GREY="\033[38;5;239m" -C_CLEAR="\033[0m" - -# retrieve options -while [ ! -z "${1}" ]; do - if [[ "${1}" =~ ^-- ]] - then - case "${1}" in - "--reference") - shift 1 - GLOBAL_PROG_REFERENCE="$(which ${1})" - ;; - "--filter") - shift 1 - GLOBAL_SPECS_FILTER="${1}" - ;; - "--show-success") - GLOBAL_SHOW_SUCCESS=1 - ;; - "--pending") - GLOBAL_RUN_PENDING_TESTS=1 - ;; - "--posix") - GLOBAL_RUN_POSIX_ONLY=1 - ;; - "--hard") - GLOBAL_RUN_HARD_TESTS=1 - ;; - "--all") - GLOBAL_RUN_ALL_TESTS=1 - ;; - *) - printf "%s\n" "Invalid option: ${1}" - exit 1 - ;; - esac - else - if [ "${GLOBAL_PROG}" == "" ] - then - [[ "${1}" =~ ^[\.][\.]\/ ]] && GLOBAL_PROG="../${1}" || GLOBAL_PROG="$(which ${1})" - fi - fi - shift 1 -done - -# go to install directory -cd "${GLOBAL_INSTALLDIR}" - -# load application sources -for FILE in ./lib/* ./lib/verbs/* -do - if [ -f "${FILE}" ] - then - source "${FILE}" - fi -done - -# create and go to temporary directory -mkdir -p "${GLOBAL_TMP_DIRECTORY}" -cd "${GLOBAL_TMP_DIRECTORY}" - -# compile support binaries -make re -C "${GLOBAL_INSTALLDIR}/support/" TARGET_DIR=${GLOBAL_TMP_DIRECTORY} 1>- 2>- - -# run main function -run_main - -# display log -printf "%s\n\nTotal tests: %s\nTotal failed tests: %s\nTotal pending tests: %s\n" "${GLOBAL_LOG}" "${GLOBAL_TOTAL_TESTS}" "${GLOBAL_TOTAL_FAILED_TESTS}" "${GLOBAL_TOTAL_PENDING_TESTS}" - -# go back to entry directory -cd "${GLOBAL_ENTRYPATH}" - -# exit with success or error status -if [ "${GLOBAL_TOTAL_FAILED_TESTS}" == "0" ] -then - exit 0 -else - exit 1 -fi diff --git a/42sh/42ShellTester/README.md b/42sh/42ShellTester/README.md deleted file mode 100644 index 8746bd71..00000000 --- a/42sh/42ShellTester/README.md +++ /dev/null @@ -1,574 +0,0 @@ -# 42ShellTester - -42ShellTester is an **integration testing framework** wrote in Bash and designed for the pedagogical projects of the Shell branch at School 42 (Paris) listed bellow: -* **minishell** -* **21sh** -* **42sh** - -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 **289 tests**. - - -## Install - -```bash -git clone https://github.com/we-sh/42ShellTester ~/42ShellTester -``` - -## Run tests - -Add the path to your Shell as argument: - -```bash -bash ~/42ShellTester/42ShellTester.sh "/ABSOLUTE/PATH/TO/YOUR/SHELL" -``` - -## Options - -##### `--filter` + `$regex` - -Run tests that matches with the specified regular expression (e.g. `--filter "builtins"`). - -##### `--reference` + `$binary` - -Run tests that does not fail with the specified Shell binary (e.g. `--reference "bash"`). - -##### `--posix` - -Run tests that are POSIX compliant only (run all by default). - -##### `--hard` - -Run tests that are marked as « hard » (omitted by default). - -##### `--pending` - -Also run pending tests. - -##### `--all` - -Equivalent to use the two options `--pending` and `--hard` together. - -##### `--show-success` - -Also display tests that succeed (hidden by default). - -## List of tests - - -* **[21sh/](spec/21sh)** - * **[misc/](spec/21sh/misc)** - * [001-no-prompt-in-non-interactive-mode](spec/21sh/misc/001-no-prompt-in-non-interactive-mode) - * [002-simple-command-line](spec/21sh/misc/002-simple-command-line) - * **[pipe/](spec/21sh/pipe)** - * [001-single-pipe](spec/21sh/pipe/001-single-pipe) - * [002-chained-pipes](spec/21sh/pipe/002-chained-pipes) - * [003-many-chained-pipes](spec/21sh/pipe/003-many-chained-pipes) - * [004-without-surrounding-whitespaces](spec/21sh/pipe/004-without-surrounding-whitespaces) - * [005-asynchronous](spec/21sh/pipe/005-asynchronous) - * [006-exit-status](spec/21sh/pipe/006-exit-status) - * **[mixed/](spec/21sh/pipe/mixed)** - * [001-exit-or-not-exit ](spec/21sh/pipe/mixed/001-exit-or-not-exit) - * [002-cd-or-not-cd ](spec/21sh/pipe/mixed/002-cd-or-not-cd) - * [003-unsetenv-or-not-unsetenv ](spec/21sh/pipe/mixed/003-unsetenv-or-not-unsetenv) - * [004-setenv-or-not-setenv ](spec/21sh/pipe/mixed/004-setenv-or-not-setenv) - * **[redirections/](spec/21sh/redirections)** - * **[inputs/](spec/21sh/redirections/inputs)** - * [001-close-stdin](spec/21sh/redirections/inputs/001-close-stdin) - * [002-filename](spec/21sh/redirections/inputs/002-filename) - * [003-filename-with-whitespaces](spec/21sh/redirections/inputs/003-filename-with-whitespaces) - * [004-absolute-path](spec/21sh/redirections/inputs/004-absolute-path) - * [005-no-such-file](spec/21sh/redirections/inputs/005-no-such-file) - * **[outputs/](spec/21sh/redirections/outputs)** - * **[appending/](spec/21sh/redirections/outputs/appending)** - * [001-append-default-to-file](spec/21sh/redirections/outputs/appending/001-append-default-to-file) - * [002-append-stdout-to-file](spec/21sh/redirections/outputs/appending/002-append-stdout-to-file) - * [003-append-stderr-to-file](spec/21sh/redirections/outputs/appending/003-append-stderr-to-file) - * **[multiple/](spec/21sh/redirections/outputs/appending/multiple)** - * [001-append-twice-separately](spec/21sh/redirections/outputs/appending/multiple/001-append-twice-separately) - * **[closing/](spec/21sh/redirections/outputs/closing)** - * [001-close-default-output](spec/21sh/redirections/outputs/closing/001-close-default-output) - * [002-close-stdout](spec/21sh/redirections/outputs/closing/002-close-stdout) - * [003-close-stderr](spec/21sh/redirections/outputs/closing/003-close-stderr) - * [004-close-twice-outputs](spec/21sh/redirections/outputs/closing/004-close-twice-outputs) - * **[touching/](spec/21sh/redirections/outputs/touching)** - * [001-works](spec/21sh/redirections/outputs/touching/001-works) - * **[truncating/](spec/21sh/redirections/outputs/truncating)** - * [001-creates-file-if-not-exits](spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits) - * [002-truncates-file-if-exists](spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists) - * [003-whitespace-before-filename](spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename) - * **[multiple/](spec/21sh/redirections/outputs/truncating/multiple)** - * [001-separately](spec/21sh/redirections/outputs/truncating/multiple/001-separately) - * [002-together-stdout-first](spec/21sh/redirections/outputs/truncating/multiple/002-together-stdout-first) - * [003-together-stderr-first](spec/21sh/redirections/outputs/truncating/multiple/003-together-stderr-first) - * [004-together](spec/21sh/redirections/outputs/truncating/multiple/004-together) - * [005-together-with-whitespaces](spec/21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces) - * **[stderr/](spec/21sh/redirections/outputs/truncating/stderr)** - * [001-works](spec/21sh/redirections/outputs/truncating/stderr/001-works) - * **[stdout/](spec/21sh/redirections/outputs/truncating/stdout)** - * [001-with-explicit-fd](spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd) - * **[separators/](spec/21sh/separators)** - * **[semicolon/](spec/21sh/separators/semicolon)** - * [001-two-commands-sequentially](spec/21sh/separators/semicolon/001-two-commands-sequentially) - * [002-n-commands-sequentially](spec/21sh/separators/semicolon/002-n-commands-sequentially) - * [003-parse-error-empty-inline-command](spec/21sh/separators/semicolon/003-parse-error-empty-inline-command) - * [004-parse-error-empty-command](spec/21sh/separators/semicolon/004-parse-error-empty-command) -* **[42sh/](spec/42sh)** - * **[builtins/](spec/42sh/builtins)** - * **[export/](spec/42sh/builtins/export)** - * [001-display-env](spec/42sh/builtins/export/001-display-env) - * [002-export-basic-key-value-1](spec/42sh/builtins/export/002-export-basic-key-value-1) - * [003-export-basic-key-value-2](spec/42sh/builtins/export/003-export-basic-key-value-2) - * [004-export-empty-variable-1](spec/42sh/builtins/export/004-export-empty-variable-1) - * [005-export-empty-variable-2](spec/42sh/builtins/export/005-export-empty-variable-2) - * [006-export-update-env-variable](spec/42sh/builtins/export/006-export-update-env-variable) - * [007-existing-environment-variable](spec/42sh/builtins/export/007-existing-environment-variable) - * [008-local-to-environment](spec/42sh/builtins/export/008-local-to-environment) - * [009-export-with-equal-but-no-value-part1](spec/42sh/builtins/export/009-export-with-equal-but-no-value-part1) - * [010-export-with-equal-but-no-value-part2](spec/42sh/builtins/export/010-export-with-equal-but-no-value-part2) - * **[errors/](spec/42sh/builtins/export/errors)** - * [001-invalid-identifier-1](spec/42sh/builtins/export/errors/001-invalid-identifier-1) - * [002-invalid-identifier-2](spec/42sh/builtins/export/errors/002-invalid-identifier-2) - * [003-illegal-option](spec/42sh/builtins/export/errors/003-illegal-option) - * **[mixed/](spec/42sh/builtins/export/mixed)** - * [001-export-and-tmp-env-part1](spec/42sh/builtins/export/mixed/001-export-and-tmp-env-part1) - * [002-export-and-tmp-env-part2](spec/42sh/builtins/export/mixed/002-export-and-tmp-env-part2) - * **[options/](spec/42sh/builtins/export/options)** - * [001-export-with-only-p-parameter](spec/42sh/builtins/export/options/001-export-with-only-p-parameter) - * [002-export-p-param-and-token-should-add-local-var-only-part1](spec/42sh/builtins/export/options/002-export-p-param-and-token-should-add-local-var-only-part1) - * [003-export-p-param-and-token-should-add-local-var-only-part2](spec/42sh/builtins/export/options/003-export-p-param-and-token-should-add-local-var-only-part2) - * [004-export-n-param](spec/42sh/builtins/export/options/004-export-n-param) - * **[escaping/](spec/42sh/escaping)** - * [001-escape-single-character-1](spec/42sh/escaping/001-escape-single-character-1) - * [002-escape-single-character-2](spec/42sh/escaping/002-escape-single-character-2) - * [003-escape-single-character-3](spec/42sh/escaping/003-escape-single-character-3) - * [004-escape-single-character-4](spec/42sh/escaping/004-escape-single-character-4) - * [005-escape-single-character-5](spec/42sh/escaping/005-escape-single-character-5) - * **[mixed/](spec/42sh/escaping/mixed)** - * **[globbing/](spec/42sh/escaping/mixed/globbing)** - * **[brace-expansion/](spec/42sh/escaping/mixed/globbing/brace-expansion)** - * [001-it-does-not-expand-braces-1](spec/42sh/escaping/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1) - * [002-it-expands-braces-1](spec/42sh/escaping/mixed/globbing/brace-expansion/002-it-expands-braces-1) - * [003-it-expands-braces-2](spec/42sh/escaping/mixed/globbing/brace-expansion/003-it-expands-braces-2) - * **[bracket-expansion/](spec/42sh/escaping/mixed/globbing/bracket-expansion)** - * [001-it-does-not-expand-brackets](spec/42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets) - * [002-escaped-inversion-mark](spec/42sh/escaping/mixed/globbing/bracket-expansion/002-escaped-inversion-mark) - * [003-it-takes-escaped-bracket-as-pattern-character](spec/42sh/escaping/mixed/globbing/bracket-expansion/003-it-takes-escaped-bracket-as-pattern-character) - * **[variable-expansion/](spec/42sh/escaping/mixed/variable-expansion)** - * [001-escape-variable-1](spec/42sh/escaping/mixed/variable-expansion/001-escape-variable-1) - * [002-it-does-not-escape-variable](spec/42sh/escaping/mixed/variable-expansion/002-it-does-not-escape-variable) - * [003-escape-variable-2](spec/42sh/escaping/mixed/variable-expansion/003-escape-variable-2) - * **[globbing/](spec/42sh/globbing)** - * **[brace-expansion/](spec/42sh/globbing/brace-expansion)** - * **[ascii-range/](spec/42sh/globbing/brace-expansion/ascii-range)** - * [001-simple-ascending-1](spec/42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1) - * [002-simple-ascending-2](spec/42sh/globbing/brace-expansion/ascii-range/002-simple-ascending-2) - * [003-simple-ascending-3](spec/42sh/globbing/brace-expansion/ascii-range/003-simple-ascending-3) - * [004-simple-descending-1](spec/42sh/globbing/brace-expansion/ascii-range/004-simple-descending-1) - * [005-simple-descending-2](spec/42sh/globbing/brace-expansion/ascii-range/005-simple-descending-2) - * [006-simple-descending-3](spec/42sh/globbing/brace-expansion/ascii-range/006-simple-descending-3) - * [007-identical-start-and-end](spec/42sh/globbing/brace-expansion/ascii-range/007-identical-start-and-end) - * [008-multiple-1](spec/42sh/globbing/brace-expansion/ascii-range/008-multiple-1) - * [009-multiple-2](spec/42sh/globbing/brace-expansion/ascii-range/009-multiple-2) - * [010-big-range](spec/42sh/globbing/brace-expansion/ascii-range/010-big-range) - * **[errors/](spec/42sh/globbing/brace-expansion/errors)** - * [001-invalid-pattern-1](spec/42sh/globbing/brace-expansion/errors/001-invalid-pattern-1) - * [002-invalid-pattern-2](spec/42sh/globbing/brace-expansion/errors/002-invalid-pattern-2) - * [003-invalid-pattern-3](spec/42sh/globbing/brace-expansion/errors/003-invalid-pattern-3) - * [004-invalid-pattern-4](spec/42sh/globbing/brace-expansion/errors/004-invalid-pattern-4) - * **[list-of-values/](spec/42sh/globbing/brace-expansion/list-of-values)** - * [001-nothing-to-be-done](spec/42sh/globbing/brace-expansion/list-of-values/001-nothing-to-be-done) - * [002-simple-test-1](spec/42sh/globbing/brace-expansion/list-of-values/002-simple-test-1) - * [003-simple-test-2](spec/42sh/globbing/brace-expansion/list-of-values/003-simple-test-2) - * **[numeric-range/](spec/42sh/globbing/brace-expansion/numeric-range)** - * [001-simple-ascending-1](spec/42sh/globbing/brace-expansion/numeric-range/001-simple-ascending-1) - * [002-simple-ascending-2](spec/42sh/globbing/brace-expansion/numeric-range/002-simple-ascending-2) - * [003-simple-ascending-3](spec/42sh/globbing/brace-expansion/numeric-range/003-simple-ascending-3) - * [004-simple-ascending-4](spec/42sh/globbing/brace-expansion/numeric-range/004-simple-ascending-4) - * [005-simple-ascending-5](spec/42sh/globbing/brace-expansion/numeric-range/005-simple-ascending-5) - * [006-simple-descending-1](spec/42sh/globbing/brace-expansion/numeric-range/006-simple-descending-1) - * [007-simple-descending-2](spec/42sh/globbing/brace-expansion/numeric-range/007-simple-descending-2) - * [008-simple-descending-3](spec/42sh/globbing/brace-expansion/numeric-range/008-simple-descending-3) - * [009-simple-descending-4](spec/42sh/globbing/brace-expansion/numeric-range/009-simple-descending-4) - * [010-simple-descending-5](spec/42sh/globbing/brace-expansion/numeric-range/010-simple-descending-5) - * [011-identical-positive-start-and-end](spec/42sh/globbing/brace-expansion/numeric-range/011-identical-positive-start-and-end) - * [012-identical-negative-start-and-end](spec/42sh/globbing/brace-expansion/numeric-range/012-identical-negative-start-and-end) - * [013-multiple-1](spec/42sh/globbing/brace-expansion/numeric-range/013-multiple-1) - * [014-multiple-2](spec/42sh/globbing/brace-expansion/numeric-range/014-multiple-2) - * [015-big-range](spec/42sh/globbing/brace-expansion/numeric-range/015-big-range) - * **[bracket-expansion/](spec/42sh/globbing/bracket-expansion)** - * **[multi/](spec/42sh/globbing/bracket-expansion/multi)** - * [001-range-and-char](spec/42sh/globbing/bracket-expansion/multi/001-range-and-char) - * [002-reverse-range-and-chars](spec/42sh/globbing/bracket-expansion/multi/002-reverse-range-and-chars) - * [003-reverse-multi-hard](spec/42sh/globbing/bracket-expansion/multi/003-reverse-multi-hard) - * [004-simple-bracket+char+range](spec/42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range) - * **[not/](spec/42sh/globbing/bracket-expansion/not)** - * [001-simple-opposit-match](spec/42sh/globbing/bracket-expansion/not/001-simple-opposit-match) - * [002-simple-opposite-range](spec/42sh/globbing/bracket-expansion/not/002-simple-opposite-range) - * **[range-pattern/](spec/42sh/globbing/bracket-expansion/range-pattern)** - * [001-alpha-range](spec/42sh/globbing/bracket-expansion/range-pattern/001-alpha-range) - * [002-numeric-range](spec/42sh/globbing/bracket-expansion/range-pattern/002-numeric-range) - * [003-ascii-range-1](spec/42sh/globbing/bracket-expansion/range-pattern/003-ascii-range-1) - * [004-ascii-range-2](spec/42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2) - * **[simple-pattern/](spec/42sh/globbing/bracket-expansion/simple-pattern)** - * [001-simple-list](spec/42sh/globbing/bracket-expansion/simple-pattern/001-simple-list) - * [002-multi-bracket](spec/42sh/globbing/bracket-expansion/simple-pattern/002-multi-bracket) - * [003-brackets-as-pattern](spec/42sh/globbing/bracket-expansion/simple-pattern/003-brackets-as-pattern) - * [004-multi-bracket-multi-char](spec/42sh/globbing/bracket-expansion/simple-pattern/004-multi-bracket-multi-char) - * **[single-char-pattern/](spec/42sh/globbing/bracket-expansion/single-char-pattern)** - * [001-single-char](spec/42sh/globbing/bracket-expansion/single-char-pattern/001-single-char) - * [002-closing-bracket-char](spec/42sh/globbing/bracket-expansion/single-char-pattern/002-closing-bracket-char) - * [003-opening-bracket-char](spec/42sh/globbing/bracket-expansion/single-char-pattern/003-opening-bracket-char) - * **[local-variable/](spec/42sh/local-variable)** - * [001-declare-and-expand-1](spec/42sh/local-variable/001-declare-and-expand-1) - * [002-declare-and-expand-2](spec/42sh/local-variable/002-declare-and-expand-2) - * [003-unknown-variable-does-not-result-in-new-argument](spec/42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument) - * [004-existing-variable-in-environment-1](spec/42sh/local-variable/004-existing-variable-in-environment-1) - * [005-existing-variable-in-environment-2](spec/42sh/local-variable/005-existing-variable-in-environment-2) - * [006-existing-variable-in-environment-3](spec/42sh/local-variable/006-existing-variable-in-environment-3) - * [007-multiple-declaration-at-a-time](spec/42sh/local-variable/007-multiple-declaration-at-a-time) - * [008-multiple-declaration-with-same-name](spec/42sh/local-variable/008-multiple-declaration-with-same-name) - * [009-last-exit-status](spec/42sh/local-variable/009-last-exit-status) - * **[mixed/](spec/42sh/local-variable/mixed)** - * **[inline-environment-variable/](spec/42sh/local-variable/mixed/inline-environment-variable)** - * [001-local-variable-shouldnt-be-set](spec/42sh/local-variable/mixed/inline-environment-variable/001-local-variable-shouldnt-be-set) - * **[redirections/](spec/42sh/local-variable/mixed/redirections)** - * [001-truncating](spec/42sh/local-variable/mixed/redirections/001-truncating) - * [002-appending](spec/42sh/local-variable/mixed/redirections/002-appending) - * [003-reading](spec/42sh/local-variable/mixed/redirections/003-reading) - * **[tilde-expansion/](spec/42sh/local-variable/mixed/tilde-expansion)** - * [001-process-tilde-expansion](spec/42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion) - * **[quoting/](spec/42sh/quoting)** - * **[double-quotes/](spec/42sh/quoting/double-quotes)** - * [001-it-works](spec/42sh/quoting/double-quotes/001-it-works) - * [002-concatenated-strings](spec/42sh/quoting/double-quotes/002-concatenated-strings) - * [003-first-argument-inhibited](spec/42sh/quoting/double-quotes/003-first-argument-inhibited) - * [004-multiline-1](spec/42sh/quoting/double-quotes/004-multiline-1) - * [005-multiline-2](spec/42sh/quoting/double-quotes/005-multiline-2) - * **[mixed/](spec/42sh/quoting/double-quotes/mixed)** - * **[escaping/](spec/42sh/quoting/double-quotes/mixed/escaping)** - * [001-escape-double-quote-1](spec/42sh/quoting/double-quotes/mixed/escaping/001-escape-double-quote-1) - * [002-escape-double-quote-2](spec/42sh/quoting/double-quotes/mixed/escaping/002-escape-double-quote-2) - * [003-escape-double-quote-3](spec/42sh/quoting/double-quotes/mixed/escaping/003-escape-double-quote-3) - * [004-it-results-in-error](spec/42sh/quoting/double-quotes/mixed/escaping/004-it-results-in-error) - * [005-it-does-not-escape-double-quote](spec/42sh/quoting/double-quotes/mixed/escaping/005-it-does-not-escape-double-quote) - * **[globbing/](spec/42sh/quoting/double-quotes/mixed/globbing)** - * **[brace-expansion/](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion)** - * [001-it-does-not-expand-braces-1](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1) - * [002-it-does-not-expand-braces-2](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2) - * [003-it-does-not-expand-braces-3](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3) - * [004-it-does-not-expand-braces-4](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/004-it-does-not-expand-braces-4) - * [005-it-does-not-expand-braces-5](spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5) - * **[bracket-expansion/](spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion)** - * [001-it-works-1](spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1) - * [002-it-works-2](spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/002-it-works-2) - * **[variable-expansion/](spec/42sh/quoting/double-quotes/mixed/variable-expansion)** - * [001-expansion-enabled](spec/42sh/quoting/double-quotes/mixed/variable-expansion/001-expansion-enabled) - * **[mixed/](spec/42sh/quoting/mixed)** - * [001-simple-and-double-quotes](spec/42sh/quoting/mixed/001-simple-and-double-quotes) - * [002-multiline](spec/42sh/quoting/mixed/002-multiline) - * **[globbing/](spec/42sh/quoting/mixed/globbing)** - * **[brace-expansion/](spec/42sh/quoting/mixed/globbing/brace-expansion)** - * [001-it-does-not-expand-braces-1](spec/42sh/quoting/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1) - * **[bracket-expansion/](spec/42sh/quoting/mixed/globbing/bracket-expansion)** - * [001-it-works-1](spec/42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1) - * [002-it-works-2](spec/42sh/quoting/mixed/globbing/bracket-expansion/002-it-works-2) - * **[variable-expansion/](spec/42sh/quoting/mixed/variable-expansion)** - * [001-it-does-not-expand-in-quotes](spec/42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes) - * **[simple-quotes/](spec/42sh/quoting/simple-quotes)** - * [001-it-works](spec/42sh/quoting/simple-quotes/001-it-works) - * [002-concatenated-strings](spec/42sh/quoting/simple-quotes/002-concatenated-strings) - * [003-first-argument-inhibited](spec/42sh/quoting/simple-quotes/003-first-argument-inhibited) - * [004-multiline-1](spec/42sh/quoting/simple-quotes/004-multiline-1) - * [005-multiline-2](spec/42sh/quoting/simple-quotes/005-multiline-2) - * **[mixed/](spec/42sh/quoting/simple-quotes/mixed)** - * **[escaping/](spec/42sh/quoting/simple-quotes/mixed/escaping)** - * [001-escape-simple-quote-1](spec/42sh/quoting/simple-quotes/mixed/escaping/001-escape-simple-quote-1) - * [002-escape-simple-quote-2](spec/42sh/quoting/simple-quotes/mixed/escaping/002-escape-simple-quote-2) - * [003-escape-simple-quote-3](spec/42sh/quoting/simple-quotes/mixed/escaping/003-escape-simple-quote-3) - * [004-it-does-not-escape-simple-quote-1](spec/42sh/quoting/simple-quotes/mixed/escaping/004-it-does-not-escape-simple-quote-1) - * [005-it-does-not-escape-simple-quote-2](spec/42sh/quoting/simple-quotes/mixed/escaping/005-it-does-not-escape-simple-quote-2) - * **[globbing/](spec/42sh/quoting/simple-quotes/mixed/globbing)** - * **[brace-expansion/](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion)** - * [001-it-does-not-expand-braces-1](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1) - * [002-it-does-not-expand-braces-2](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2) - * [003-it-does-not-expand-braces-3](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3) - * [004-it-does-not-expand-braces-4](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/004-it-does-not-expand-braces-4) - * [005-it-does-not-expand-braces-5](spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5) - * **[bracket-expansion/](spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion)** - * [001-it-works-1](spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1) - * [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) - * **[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) - * [003-multiline](spec/42sh/subshell/003-multiline) - * [004-exit-status](spec/42sh/subshell/004-exit-status) - * [005-copy-of-environment](spec/42sh/subshell/005-copy-of-environment) - * **[errors/](spec/42sh/subshell/errors)** - * [001-parse-error-1](spec/42sh/subshell/errors/001-parse-error-1) - * [002-parse-error-2](spec/42sh/subshell/errors/002-parse-error-2) - * [003-parse-error-3](spec/42sh/subshell/errors/003-parse-error-3) - * [004-parse-error-4](spec/42sh/subshell/errors/004-parse-error-4) - * **[mixed/](spec/42sh/subshell/mixed)** - * **[builtins/](spec/42sh/subshell/mixed/builtins)** - * **[cd/](spec/42sh/subshell/mixed/builtins/cd)** - * [001-it-does-not-change-current-directory](spec/42sh/subshell/mixed/builtins/cd/001-it-does-not-change-current-directory) - * [002-multiline](spec/42sh/subshell/mixed/builtins/cd/002-multiline) - * **[exit/](spec/42sh/subshell/mixed/builtins/exit)** - * [001-exiting-subshell](spec/42sh/subshell/mixed/builtins/exit/001-exiting-subshell) - * **[setenv/](spec/42sh/subshell/mixed/builtins/setenv)** - * [001-it-does-not-modify-parent-environment](spec/42sh/subshell/mixed/builtins/setenv/001-it-does-not-modify-parent-environment) - * **[unsetenv/](spec/42sh/subshell/mixed/builtins/unsetenv)** - * [001-it-does-not-modify-parent-environment](spec/42sh/subshell/mixed/builtins/unsetenv/001-it-does-not-modify-parent-environment) - * **[escaping/](spec/42sh/subshell/mixed/escaping)** - * [001-escaped-subshell-1](spec/42sh/subshell/mixed/escaping/001-escaped-subshell-1) - * [002-escaped-subshell-2](spec/42sh/subshell/mixed/escaping/002-escaped-subshell-2) - * **[inline-environment-variable/](spec/42sh/subshell/mixed/inline-environment-variable)** - * [001-modifies-the-child-environment-only-1](spec/42sh/subshell/mixed/inline-environment-variable/001-modifies-the-child-environment-only-1) - * [002-modifies-the-child-environment-only-2](spec/42sh/subshell/mixed/inline-environment-variable/002-modifies-the-child-environment-only-2) - * **[piping/](spec/42sh/subshell/mixed/piping)** - * [001-subshells-inside-piped-command](spec/42sh/subshell/mixed/piping/001-subshells-inside-piped-command) - * [002-pipes-inside-subshells](spec/42sh/subshell/mixed/piping/002-pipes-inside-subshells) - * [003-imbricated-subshells-and-pipes](spec/42sh/subshell/mixed/piping/003-imbricated-subshells-and-pipes) - * **[quoting/](spec/42sh/subshell/mixed/quoting)** - * [001-with-simple-quotes](spec/42sh/subshell/mixed/quoting/001-with-simple-quotes) - * [002-with-double-quotes](spec/42sh/subshell/mixed/quoting/002-with-double-quotes) - * [003-with-simple-and-double-quotes](spec/42sh/subshell/mixed/quoting/003-with-simple-and-double-quotes) -* **[bonuses/](spec/bonuses)** - * **[builtins/](spec/bonuses/builtins)** - * **[env/](spec/bonuses/builtins/env)** - * [001-unset-variables ](spec/bonuses/builtins/env/001-unset-variables) - * [002-unset-and-set-variable ](spec/bonuses/builtins/env/002-unset-and-set-variable) - * **[inline-environment-variable/](spec/bonuses/inline-environment-variable)** - * [001-modifies-child-environment-1](spec/bonuses/inline-environment-variable/001-modifies-child-environment-1) - * [002-modifies-child-environment-2](spec/bonuses/inline-environment-variable/002-modifies-child-environment-2) - * [003-modifies-PATH-only](spec/bonuses/inline-environment-variable/003-modifies-PATH-only) - * **[redirections/](spec/bonuses/redirections)** - * [001-append-twice-outputs-together ](spec/bonuses/redirections/001-append-twice-outputs-together) - * **[separators/](spec/bonuses/separators)** - * **[and/](spec/bonuses/separators/and)** - * [001-run-twice](spec/bonuses/separators/and/001-run-twice) - * [002-do-not-run-second](spec/bonuses/separators/and/002-do-not-run-second) - * [003-run-until-failing](spec/bonuses/separators/and/003-run-until-failing) - * **[errors/](spec/bonuses/separators/and/errors)** - * [001-parse-error-at-beginning](spec/bonuses/separators/and/errors/001-parse-error-at-beginning) - * [002-parse-error-too-much-symbol](spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol) - * **[mixed/](spec/bonuses/separators/mixed)** - * [001-and-or](spec/bonuses/separators/mixed/001-and-or) - * [002-and-or](spec/bonuses/separators/mixed/002-and-or) - * [003-and-or](spec/bonuses/separators/mixed/003-and-or) - * [004-or-and](spec/bonuses/separators/mixed/004-or-and) - * [005-or-and](spec/bonuses/separators/mixed/005-or-and) - * [006-or-and](spec/bonuses/separators/mixed/006-or-and) - * **[or/](spec/bonuses/separators/or)** - * [001-run-first-only](spec/bonuses/separators/or/001-run-first-only) - * [002-run-second-only](spec/bonuses/separators/or/002-run-second-only) - * [003-run-until-succeeding](spec/bonuses/separators/or/003-run-until-succeeding) - * **[errors/](spec/bonuses/separators/or/errors)** - * [001-parse-error-at-beginning](spec/bonuses/separators/or/errors/001-parse-error-at-beginning) - * [002-parse-error-too-much-symbol](spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol) - * **[tilde-expansion/](spec/bonuses/tilde-expansion)** - * [001-expanded-with-HOME-1](spec/bonuses/tilde-expansion/001-expanded-with-HOME-1) - * [002-expanded-with-HOME-2](spec/bonuses/tilde-expansion/002-expanded-with-HOME-2) - * [003-expanded-with-PWD-1](spec/bonuses/tilde-expansion/003-expanded-with-PWD-1) - * [004-expanded-with-PWD-2](spec/bonuses/tilde-expansion/004-expanded-with-PWD-2) - * [005-expanded-with-OLDPWD-1](spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1) - * [006-expanded-with-OLDPWD-2](spec/bonuses/tilde-expansion/006-expanded-with-OLDPWD-2) - * **[not-expanded/](spec/bonuses/tilde-expansion/not-expanded)** - * [001-not-expanded-with-HOME-1](spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1) - * [002-not-expanded-with-HOME-2](spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2) - * [003-not-expanded-with-PWD](spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD) - * [004-not-expanded-with-OLDPWD](spec/bonuses/tilde-expansion/not-expanded/004-not-expanded-with-OLDPWD) -* **[minishell/](spec/minishell)** - * **[binary/](spec/minishell/binary)** - * [001-binary-path-relative](spec/minishell/binary/001-binary-path-relative) - * [002-binary-path-absolute](spec/minishell/binary/002-binary-path-absolute) - * [003-binary-test-exec-order](spec/minishell/binary/003-binary-test-exec-order) - * [004-binary-test-empty-path](spec/minishell/binary/004-binary-test-empty-path) - * [005-binary-test-wrong-path](spec/minishell/binary/005-binary-test-wrong-path) - * [006-binary-undefined-path](spec/minishell/binary/006-binary-undefined-path) - * [007-binary-permission-denied](spec/minishell/binary/007-binary-permission-denied) - * [008-binary-too-many-symbolic-links-encountered](spec/minishell/binary/008-binary-too-many-symbolic-links-encountered) - * **[builtins/](spec/minishell/builtins)** - * **[cd/](spec/minishell/builtins/cd)** - * [001-no-arg](spec/minishell/builtins/cd/001-no-arg) - * [002-current-directory](spec/minishell/builtins/cd/002-current-directory) - * [003-current-directory-2](spec/minishell/builtins/cd/003-current-directory-2) - * [004-parent-directory](spec/minishell/builtins/cd/004-parent-directory) - * [005-root-path](spec/minishell/builtins/cd/005-root-path) - * [006-root-path-2](spec/minishell/builtins/cd/006-root-path-2) - * [007-symbolic-link](spec/minishell/builtins/cd/007-symbolic-link) - * [008-symbolic-link-2](spec/minishell/builtins/cd/008-symbolic-link-2) - * [009-following-links ](spec/minishell/builtins/cd/009-following-links) - * [010-update-OLDPWD](spec/minishell/builtins/cd/010-update-OLDPWD) - * [011-dotdot](spec/minishell/builtins/cd/011-dotdot) - * [012-dot](spec/minishell/builtins/cd/012-dot) - * [013-absolute-path](spec/minishell/builtins/cd/013-absolute-path) - * **[errors/](spec/minishell/builtins/cd/errors)** - * [001-not-a-directory](spec/minishell/builtins/cd/errors/001-not-a-directory) - * [002-not-a-directory-2](spec/minishell/builtins/cd/errors/002-not-a-directory-2) - * [003-permission-denied](spec/minishell/builtins/cd/errors/003-permission-denied) - * [004-permission-denied-2](spec/minishell/builtins/cd/errors/004-permission-denied-2) - * [005-too-many-symbolic-links-encountered](spec/minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered) - * [006-too-many-symbolic-links-encountered-2](spec/minishell/builtins/cd/errors/006-too-many-symbolic-links-encountered-2) - * [007-no-such-file-or-directory](spec/minishell/builtins/cd/errors/007-no-such-file-or-directory) - * [008-no-such-file-or-directory-2](spec/minishell/builtins/cd/errors/008-no-such-file-or-directory-2) - * [009-no-such-file-or-directory-symlink](spec/minishell/builtins/cd/errors/009-no-such-file-or-directory-symlink) - * [010-no-such-file-or-directory-symlink-2](spec/minishell/builtins/cd/errors/010-no-such-file-or-directory-symlink-2) - * **[options/](spec/minishell/builtins/cd/options)** - * [001-not-following-links](spec/minishell/builtins/cd/options/001-not-following-links) - * [002-oldpwd](spec/minishell/builtins/cd/options/002-oldpwd) - * **[env/](spec/minishell/builtins/env)** - * [001-env-same-value-as-parent](spec/minishell/builtins/env/001-env-same-value-as-parent) - * [002-env-check-usefull-var](spec/minishell/builtins/env/002-env-check-usefull-var) - * [003-ignore-environment](spec/minishell/builtins/env/003-ignore-environment) - * [005-set-variables](spec/minishell/builtins/env/005-set-variables) - * **[errors/](spec/minishell/builtins/env/errors)** - * [001-command-not-found](spec/minishell/builtins/env/errors/001-command-not-found) - * [002-illegal-option](spec/minishell/builtins/env/errors/002-illegal-option) - * **[multiple-options/](spec/minishell/builtins/env/multiple-options)** - * [001-ignore-environment-and-set-variable](spec/minishell/builtins/env/multiple-options/001-ignore-environment-and-set-variable) - * **[exit/](spec/minishell/builtins/exit)** - * [001-without-any-argument](spec/minishell/builtins/exit/001-without-any-argument) - * [002-status-passed-as-argument](spec/minishell/builtins/exit/002-status-passed-as-argument) - * [003-status-of-last-command](spec/minishell/builtins/exit/003-status-of-last-command) - * **[errors/](spec/minishell/builtins/exit/errors)** - * [001-too-many-args](spec/minishell/builtins/exit/errors/001-too-many-args) - * [002-non-numeric-argument](spec/minishell/builtins/exit/errors/002-non-numeric-argument) - * **[mixed/](spec/minishell/builtins/mixed)** - * [001-setenv-unsetenv](spec/minishell/builtins/mixed/001-setenv-unsetenv) - * **[setenv/](spec/minishell/builtins/setenv)** - * [001-no-argument](spec/minishell/builtins/setenv/001-no-argument) - * [002-add-new-variable](spec/minishell/builtins/setenv/002-add-new-variable) - * [003-set-existing-variable](spec/minishell/builtins/setenv/003-set-existing-variable) - * [004-invalid-identifier](spec/minishell/builtins/setenv/004-invalid-identifier) - * [005-add-and-set-multiple-variables](spec/minishell/builtins/setenv/005-add-and-set-multiple-variables) - * **[unsetenv/](spec/minishell/builtins/unsetenv)** - * [001-unsetenv-first-elem](spec/minishell/builtins/unsetenv/001-unsetenv-first-elem) - * [002-unsetenv-mult-envp](spec/minishell/builtins/unsetenv/002-unsetenv-mult-envp) - * [003-unsetenv-mult-envp-inline](spec/minishell/builtins/unsetenv/003-unsetenv-mult-envp-inline) - * **[misc/](spec/minishell/misc)** - * [001-copy-of-environment](spec/minishell/misc/001-copy-of-environment) - - - -# Development - -## Coding convention - -* Scope indentation must be done with 2 spaces -* Variable names must be upper case (e.g. `INDEX`) -* Global variables must be prefixed with `GLOBAL_` (e.g. `GLOBAL_TOKEN`) -* Variable expansion must be surrounded by curly braces (e.g. `${VARIABLE}`) -* Arguments of functions and commands must be surrounded by double or simple quotes (e.g. `run_assert "STDERR"`) -* Semicolon are banned so that words like `then` and `do` are always at start of lines (e.g. wrong inline code: `if [ ... ]; then cmd; fi`) -* Folder names may only contain alphanumeric and `-` - -## Adding new test - -An integration test must be **self-sufficient**, that means executing the full test suite or only one test must result in the same failed or success status. The framework 42ShellTester brings you tools for that! - -Firstly, tests are executed inside a temporary folder `tmp/` that is created at launch time and placed at the root installation folder of the framework. You may generate temporary files, binaries and folders that are needed for your test, but pay attention to not touch external folders. Use the `before_exec` callback to generate these resources. - -Secondly, each test is executed within a sub-shell, so that you may modify the environment without disrupting the test suite. Use the `before_exec` callback to modify the environment. - -Thirdly, a test must concern one single feature at a time, that means **wherever possible** you must avoid the use of multiple builtins or capabilities (e.g. do not use a pipe `|` within a test that concerns the builtin `env`, or again use absolute paths to binaries like `/bin/ls` to let the Shell implementation not support the `PATH`, except if you precisely test this feature!). - -Fourthly, when a test need binaries like `/bin/env` or `/bin/echo`, prefer to recode your own, simplier and multi-platform, and place it in `support/` folder. Then use the `before_exec` callback to compile it and make it available for your test. - -Sixthly, a test that is not POSIX compliant must contain a file named `non-posix` containing a small explanation of why. - -Finally, don't write a README and let the task `generate_readmes` do it for you :-) A description may be added in a file named `description` that will appear at the top of the README. - -Follow the guideline to add a new test: - -1. Create a sub-folder in `spec/` (e.g. `spec/minishell/builtin/cd/new-test/`) -2. If necessary, create a file `before_exec` that contains the shell commands that prepare the environment and the temporary resources (e.g. `mkdir valid_folder`) -2. Create a file `stdin` that contains the shell command you want to test (e.g. `cd invalid_folder`) -3. Create the files `stdout` and/or `stderr` that contain the expected output assertions (e.g. in stderr: `expected_to_not be_empty`) (see available assertions and verbs bellow) -4. You may also create a file `misc` that contains special expectations not concerning output on standard and error (e.g. `expected_to_not exit_with_status 0`) -5. If necessary, create a file `description` that describes more precisely the purpose of the test (e.g. `Trying to access invalid folder must display an error on standard error and result in a failure status code`) (the description will be included at top of the auto-generated README) -6. If the test is not POSIX compliant, create a file `non-posix` that explains why. - -## Assertions - -* **`expected_to`** / **`expected_to_not`** + *`verb`*: An assertion beginning with **expected_to** (or its opposite **expected_to_not**) makes the test resulting in failure status if the expectation that follows **does not** comply. - -* **`might`** / **`might_not`** + *`verb`*: An assertion beginning with **might** (or its opposite **might_not**) always makes the test resulting in success status. When the expectation that follows **may not** comply, it is nevertheless considered as success but it displays a warning message. - -## Verbs - -* **`be_empty`**: Actual output is empty. -* **`create_file`** + *`$filename`*: Actual command creates a file named *$filename*. May also be followed with a file test: - * **`matching_regex`** + *`$regex`*: At least one line of the file matches with the regular expression *$regex*. - * **`not_matching_regex`** + *`$regex`*: Any line of the file does match with the regular expression *$regex*. - * **`with_nb_of_lines`** + *`$int`*: The file contains exactly *$int* lines. -* **`exit_with_status`** + *`$int`*: The Shell termination results in the exit status *$int*. -* **`have_nb_of_lines`** + *`$int`*: Actual output contains exactly *$int* lines. -* **`match_regex`** + *`$regex`*: At least one line of actual output does match with the regular expression *$regex*. - * **`once`**: The matching is limited to only one occurrence. - * *`$int`* **`times`**: The matching must exactly occur *$int* times. -* **`match_each_regex_of_file`** + *`$filename`*: Actual output does match with each regular expression contained in the file named *$filename* (in an indifferent order). - -## Adding new verb - -A verb is a function that is prefixed by `run_verb_` and that returns `0` or `1` according to the tested behavior. It may return a status `255` when bad or missing argument. - -At runtime, the framework provides a list of variables that can be used by the verbs: - -* **`RESPONSE`**: The path to the file containing actual output (STDOUT or STDERR) -* **`RESPONSE_EXIT_STATUS`**: The exit status of the Shell termination -* **`EXPECTED_TO_ARGS[]`**: An array containing the arguments following the verb - -Follow the guideline to add a new verb: - -1. Choose the best name that respects the *CamelCase* convention and that can be human-readable when used with an assertion (e.g. `expected_to be_empty` can be read `actual output is expected to be empty`) -2. Create a file in `lib/verbs/` with the exact name of the verb and that is prefixed with `run_verb_` (e.g. `lib/verbs/run_verb_be_empty.sh` -3. Add a *shebang*: `#!/bin/sh` and a comment that describes the tested behavior -4. Create a function with the exact name of the verb and that is prefixed with `run_verb_` (the same as the file name) and make it respect the following rules: - * Local variables must be declared with `local` - * No output can be done with `echo` or `printf` - * Function returns `0` on succes, `1` on fail or `255` on bad use - * Use the array `EXPECTED_TO_ARGS[]` to take advantage of arguments (e.g. `expected_to match_regex "regex"`, then `EXPECTED_TO_ARGS[0]` contains `regex`) - -## Support binaries - -The framework 42ShellTester provides several binaries to be used within the tests. Using them instead of using Unix binaries prevents from undefined behaviors and compatibility errors. - -Find the available list of support binaries bellow: - - - -* **[./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". - - - -## Tasks - -* `bash ./tasks/generate_readmes.sh` (only on master branch) to automaticaly generate the README files of tests - -# The Team - -* **Adrien Nouvel** [@anouvel](https://github.com/anouvel) -* **Gabriel Kuma** [@gabkk](https://github.com/gabkk) -* **Jean-Michel Gigault** [@jgigault](https://github.com/jgigault) - -## Logo credits - -Edouard Audeguy -Illustrateur / Infographiste -https://edouardaudeguy.wix.com/portfolio diff --git a/42sh/42ShellTester/lib/assert.sh b/42sh/42ShellTester/lib/assert.sh deleted file mode 100644 index b23d96c4..00000000 --- a/42sh/42ShellTester/lib/assert.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -# /* -# Assert logic -# -# run_assert -# @param -> prefix applied to output file name -# @param -> output that is tested (STDOUT, STDERR or MISC) -# function that: -# - sets the variable RESPONSE with the path of the file that stores the actual output -# - iterates over the current test configuration file ('stdout', 'stderr' or 'misc') -# - calls the expected type of assertion ('expected', 'might' or their opposite) -# -# run_expected_to -# run_expected_to_not -# run_might -# run_might_to -# @param -> current test (e.g. 'expected_to be_empty') -# functions that calls the verbs and treats their exit status -# */ - -run_assert() -{ - local LINE - local PREFIX_STD="${1}" - local EXPECTED_STD="RESPONSE_${PREFIX_STD}${2}" - local RESPONSE="${!EXPECTED_STD}" - local EXPECTED_STD_NAME="${2}" - local RESPONSE_EXIT_STATUS_VAR="${PREFIX_STD}EXIT_STATUS" - local RESPONSE_EXIT_STATUS="${!RESPONSE_EXIT_STATUS_VAR}" - local TEST_CMD - local OLD_IFS="${IFS}" - local ASSERT_STATUS="0" - local CURRENT_ASSERT_STATUS - local DISPLAY_LINE - - IFS=$'\n' - for LINE in $(awk '{gsub(/\\\\/, "\\\\\\\\\\\\\\\\"); print}' "${TEST}/$(echo "${EXPECTED_STD_NAME}" | awk '{print tolower($0)}')") - do - TEST_CMD="$(echo "${LINE}" | awk '{ print $1 }')" - DISPLAY_LINE="$(printf "${LINE}" | awk -v GLOBAL_TOKEN="${GLOBAL_TOKEN}" -v GLOBAL_INSTALLDIR="${GLOBAL_INSTALLDIR}" -v GLOBAL_TMP_DIRECTORY="${GLOBAL_TMP_DIRECTORY}" -v PATH="${PATH}" -v HOME="${HOME}" '{i=1; while(i <= NF) {gsub(/^"/, "`", $i); gsub(/"$/, "`", $i); i++}; gsub(/\\\\\\\\/, "\\"); gsub(/\$\{GLOBAL_TOKEN\}/, GLOBAL_TOKEN); gsub(/\$\{GLOBAL_INSTALLDIR\}/, GLOBAL_INSTALLDIR); gsub(/\$\{GLOBAL_TMP_DIRECTORY\}/, GLOBAL_TMP_DIRECTORY); gsub(/\$\{PATH\}/, PATH); gsub(/\$\{HOME\}/, HOME); print}')" - eval "run_${TEST_CMD}" ${LINE} - CURRENT_ASSERT_STATUS="${?}" - if [ "${CURRENT_ASSERT_STATUS}" != "0" ] - then - [ "${ASSERT_STATUS}" == "0" -o "${ASSERT_STATUS}" == "2" ] && ASSERT_STATUS="${CURRENT_ASSERT_STATUS}" - fi - done - IFS="${OLD_IFS}" - - return "${ASSERT_STATUS}" -} - -run_expected_to() -{ - shift 1 - local EXPECTED_TO_CMD="${1}" - shift 1 - local -a EXPECTED_TO_ARGS='(${@})' - local ASSERT_STATUS - - eval "run_verb_${EXPECTED_TO_CMD}" - ASSERT_STATUS="${?}" - case "${ASSERT_STATUS}" in - 0) - printf "${C_GREEN} %-10s %s${C_CLEAR}\n" "SUCCESS" "${DISPLAY_LINE}" ;; - 1) - printf "${C_RED} %-10s %s${C_CLEAR}\n" "FAILURE" "${DISPLAY_LINE}" ;; - 255) - printf "${C_RED} [!] INVALID TEST COMMAND: %s${C_CLEAR}\n" "${DISPLAY_LINE}" ;; - esac - - return "${ASSERT_STATUS}" -} - -run_expected_to_not() -{ - shift 1 - local EXPECTED_TO_CMD="${1}" - shift 1 - local -a EXPECTED_TO_ARGS='(${@})' - local ASSERT_STATUS - - eval "run_verb_${EXPECTED_TO_CMD}" - ASSERT_STATUS="${?}" - case "${ASSERT_STATUS}" in - 1) - ASSERT_STATUS="0" - printf "${C_GREEN} %-10s %s${C_CLEAR}\n" "SUCCESS" "${DISPLAY_LINE}" ;; - 0) - ASSERT_STATUS="1" - printf "${C_RED} %-10s %s${C_CLEAR}\n" "FAILURE" "${DISPLAY_LINE}" ;; - 255) - printf "${C_RED} [!] INVALID TEST COMMAND: %s${C_CLEAR}\n" "${DISPLAY_LINE}" ;; - esac - - return "${ASSERT_STATUS}" -} - -run_might() -{ - shift 1 - local EXPECTED_TO_CMD="${1}" - shift 1 - local -a EXPECTED_TO_ARGS='(${@})' - local ASSERT_STATUS - - eval "run_verb_${EXPECTED_TO_CMD}" - ASSERT_STATUS="${?}" - case "${ASSERT_STATUS}" in - 0) - printf "${C_GREEN} %-10s %s${C_CLEAR}\n" "SUCCESS" "${DISPLAY_LINE}" ;; - 1) - ASSERT_STATUS="2" - printf "${C_YELLOW} %-10s %s${C_CLEAR}\n" "WARNING" "${DISPLAY_LINE}" ;; - 255) - printf "${C_RED} [!] INVALID TEST COMMAND: %s${C_CLEAR}\n" "${DISPLAY_LINE}" ;; - esac - - return "${ASSERT_STATUS}" -} - -run_might_not() -{ - shift 1 - local EXPECTED_TO_CMD="${1}" - shift 1 - local -a EXPECTED_TO_ARGS='(${@})' - local ASSERT_STATUS - - eval "run_verb_${EXPECTED_TO_CMD}" - ASSERT_STATUS="${?}" - case "${ASSERT_STATUS}" in - 1) - ASSERT_STATUS="0" - printf "${C_GREEN} %-10s %s${C_CLEAR}\n" "SUCCESS" "${DISPLAY_LINE}" ;; - 0) - ASSERT_STATUS="2" - printf "${C_YELLOW} %-10s %s${C_CLEAR}\n" "WARNING" "${DISPLAY_LINE}" ;; - 255) - printf "${C_RED} [!] INVALID TEST COMMAND: ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "${DISPLAY_LINE}" ;; - esac - - return "${ASSERT_STATUS}" -} diff --git a/42sh/42ShellTester/lib/assets/42ShellTester.ascii b/42sh/42ShellTester/lib/assets/42ShellTester.ascii deleted file mode 100644 index c74786df..00000000 --- a/42sh/42ShellTester/lib/assets/42ShellTester.ascii +++ /dev/null @@ -1,21 +0,0 @@ - #### ######## - #### ## #### - #### ##### - ########### ##### # - ########### ######## - #### - ################### #### - ################### - ################### - ################### ##### - ########## ##### - ########## ############ - ########## ############ -# ########## ############ -### ######### ##### -##### ####### ##### -####### ##### ##### -######### ### ##### - #### - ### - ## diff --git a/42sh/42ShellTester/lib/assets/42ShellTester.png b/42sh/42ShellTester/lib/assets/42ShellTester.png deleted file mode 100644 index aa14b009..00000000 Binary files a/42sh/42ShellTester/lib/assets/42ShellTester.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/42ShellTester_250x250.png b/42sh/42ShellTester/lib/assets/42ShellTester_250x250.png deleted file mode 100644 index 32114b80..00000000 Binary files a/42sh/42ShellTester/lib/assets/42ShellTester_250x250.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/42ShellTester_416x416.png b/42sh/42ShellTester/lib/assets/42ShellTester_416x416.png deleted file mode 100644 index 16b83efc..00000000 Binary files a/42sh/42ShellTester/lib/assets/42ShellTester_416x416.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/42ShellTester_cropped.png b/42sh/42ShellTester/lib/assets/42ShellTester_cropped.png deleted file mode 100644 index e633e2aa..00000000 Binary files a/42sh/42ShellTester/lib/assets/42ShellTester_cropped.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/42shTestsTeamLogo.png b/42sh/42ShellTester/lib/assets/42shTestsTeamLogo.png deleted file mode 100644 index 07609eac..00000000 Binary files a/42sh/42ShellTester/lib/assets/42shTestsTeamLogo.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/42shTestsTeamLogo_sm.png b/42sh/42ShellTester/lib/assets/42shTestsTeamLogo_sm.png deleted file mode 100644 index cb25d709..00000000 Binary files a/42sh/42ShellTester/lib/assets/42shTestsTeamLogo_sm.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/README.md b/42sh/42ShellTester/lib/assets/README.md deleted file mode 100644 index 2a50a487..00000000 --- a/42sh/42ShellTester/lib/assets/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## logo credits - -Edouard Audeguy -Illustrateur / Infographiste -https://edouardaudeguy.wix.com/portfolio diff --git a/42sh/42ShellTester/lib/assets/hard.png b/42sh/42ShellTester/lib/assets/hard.png deleted file mode 100644 index 256dd7fd..00000000 Binary files a/42sh/42ShellTester/lib/assets/hard.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/non-posix.png b/42sh/42ShellTester/lib/assets/non-posix.png deleted file mode 100644 index 5a5fa705..00000000 Binary files a/42sh/42ShellTester/lib/assets/non-posix.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/assets/pending.png b/42sh/42ShellTester/lib/assets/pending.png deleted file mode 100644 index c07a3e7c..00000000 Binary files a/42sh/42ShellTester/lib/assets/pending.png and /dev/null differ diff --git a/42sh/42ShellTester/lib/main.sh b/42sh/42ShellTester/lib/main.sh deleted file mode 100644 index 6a665006..00000000 --- a/42sh/42ShellTester/lib/main.sh +++ /dev/null @@ -1,280 +0,0 @@ -#!/bin/bash - -# /* -# Main function -# -# run_main -# function that: -# - iterates over the spec folder -# - executes the tests and their callbacks -# - displays the results -# */ - -run_main() -{ - local TEST - local TEST_NAME - local TEST_FULLNAME - local RESULT - local RESPONSE_STDOUT - local RESPONSE_STDERR - local EXIT_STATUS - local RESPONSE_REFERENCE_STDOUT - local RESPONSE_REFERENCE_STDERR - local REFERENCE_EXIT_STATUS - local RUN_TEST - local RUN_ASSERT - local TEST_STATUS - local ASSERT_STATUS - local LOG_CURRENT_TEST - local LOG_CURRENT_TEST_STDOUT - local LOG_CURRENT_TEST_STDERR - local LOG_CURRENT_TEST_MISC - local LOG_SUCCESS_TESTS - local LOG_FAILED_TESTS - local AWK_PATH="$(which "awk")" - local OLD_IFS="${IFS}" - local UNAME=`uname` - local FIND="find" - - # Use find instead find -E on Linux - if [ {UNAME} == "Darwin" ]; then - FIND= "find -E" - fi - - if [ ! -f "${GLOBAL_PROG}" ] - then - [ "${GLOBAL_PROG}" == "" ] && printf "%s\n" "Missing argument: specify the binary to test" && return - [ ! -f "${GLOBAL_PROG}" -a ! -f "$(which "${GLOBAL_PROG}")" ] && printf "%s\n" "Wrong argument: no such file '"${GLOBAL_PROG}"'" && return - fi - - IFS=$'\n' - for TEST in $(${FIND} "${GLOBAL_INSTALLDIR}/spec" -type d -regex "${GLOBAL_INSTALLDIR}/spec/.*${GLOBAL_SPECS_FILTER}.*") - do - [ -f "${TEST}/pending" -a "${GLOBAL_RUN_PENDING_TESTS}" == "0" ] && (( GLOBAL_TOTAL_PENDING_TESTS = GLOBAL_TOTAL_PENDING_TESTS + 1 )) - if [ -f "${TEST}/stdin" ] && [ ! -f "${TEST}/non-posix" -o "${GLOBAL_RUN_POSIX_ONLY}" == "0" ] && [ ! -f "${TEST}/pending" -o "${GLOBAL_RUN_PENDING_TESTS}" == "1" -o "${GLOBAL_RUN_ALL_TESTS}" == "1" ] && [ ! -f "${TEST}/hard" -o "${GLOBAL_RUN_HARD_TESTS}" == "1" -o "${GLOBAL_RUN_ALL_TESTS}" == "1" ] - then - - # compile support binaries - make -C "${GLOBAL_INSTALLDIR}/support/" TARGET_DIR=${GLOBAL_TMP_DIRECTORY} 1>- 2>- - - TEST_NAME="${TEST##*/}" - TEST_FULLNAME="${TEST##*spec/}" - RUN_TEST=0 - TEST_STATUS="0" - LOG_CURRENT_TEST="${TEST_FULLNAME}" - LOG_CURRENT_TEST_STDOUT="" - LOG_CURRENT_TEST_STDERR="" - LOG_CURRENT_TEST_MISC="" - - RESPONSE_STDOUT="${GLOBAL_TMP_DIRECTORY}/${TEST_FULLNAME//\//-}.stdout" - RESPONSE_STDERR="${GLOBAL_TMP_DIRECTORY}/${TEST_FULLNAME//\//-}.stderr" - RESPONSE_REFERENCE_STDOUT="${GLOBAL_TMP_DIRECTORY}/${TEST_FULLNAME//\//-}.ref.stdout" - RESPONSE_REFERENCE_STDERR="${GLOBAL_TMP_DIRECTORY}/${TEST_FULLNAME//\//-}.ref.stderr" - - rm -f "${GLOBAL_TMP_DIRECTORY}/stdin" - local INDEX=1 - local LINE - local TOTAL=$(awk 'END {print NR+1}' "${TEST}/stdin") - while [ "$INDEX" -le "$TOTAL" ] - do - awk -v INDEX="${INDEX}" -v GLOBAL_TOKEN="${GLOBAL_TOKEN}" -v GLOBAL_INSTALLDIR="${GLOBAL_INSTALLDIR}" -v GLOBAL_TMP_DIRECTORY="${GLOBAL_TMP_DIRECTORY}" -v PATH="${PATH}" -v HOME="${HOME}" 'NR == INDEX {gsub(/\$\{GLOBAL_TOKEN\}/, GLOBAL_TOKEN); gsub(/\$\{GLOBAL_INSTALLDIR\}/, GLOBAL_INSTALLDIR); gsub(/\$\{GLOBAL_TMP_DIRECTORY\}/, GLOBAL_TMP_DIRECTORY); gsub(/\$\{PATH\}/, PATH); gsub(/\$\{HOME\}/, HOME); print; exit}' "${TEST}/stdin" >>"${GLOBAL_TMP_DIRECTORY}/stdin" - - (( INDEX += 1 )) - done - - ( - SUBSHELL_EXIT_STATUS= - - if [ -f "${TEST}/before_exec" ] - then - - local INDEX=0 - local TOTAL=$(${AWK_PATH} 'END {print NR+1}' "${TEST}/before_exec") - while [ "$INDEX" -le "$TOTAL" ] - do - eval $(${AWK_PATH} -v INDEX="${INDEX}" 'NR == INDEX {print $0; exit}' "${TEST}/before_exec") - (( INDEX += 1 )) - done - - fi - - eval "${GLOBAL_PROG}" < "${GLOBAL_TMP_DIRECTORY}/stdin" 1> "${RESPONSE_STDOUT}.raw" 2> "${RESPONSE_STDERR}.raw" - SUBSHELL_EXIT_STATUS=${?} - - if [ -f "${TEST}/after_exec" ] - then - - local INDEX=0 - local TOTAL=$(${AWK_PATH} 'END {print NR+1}' "${TEST}/after_exec") - while [ "$INDEX" -le "$TOTAL" ] - do - eval $(${AWK_PATH} -v INDEX="${INDEX}" 'NR == INDEX {print $0; exit}' "${TEST}/after_exec") - (( INDEX += 1 )) - done - - fi - - exit "${SUBSHELL_EXIT_STATUS}" - ) - EXIT_STATUS=${?} - - awk '{gsub(/\033\[[0-9;]*m/, ""); print}' "${RESPONSE_STDOUT}.raw" > "${RESPONSE_STDOUT}" - awk '{gsub(/\033\[[0-9;]*m/, ""); print}' "${RESPONSE_STDERR}.raw" > "${RESPONSE_STDERR}" - - if [ "${GLOBAL_PROG_REFERENCE}" != "" ] - then - ( - SUBSHELL_EXIT_STATUS= - - if [ -f "${TEST}/before_exec" ] - then - - local INDEX=0 - local TOTAL=$(${AWK_PATH} 'END {print NR+1}' "${TEST}/before_exec") - while [ "$INDEX" -le "$TOTAL" ] - do - eval $(${AWK_PATH} -v INDEX="${INDEX}" 'NR == INDEX {print $0; exit}' "${TEST}/before_exec") - (( INDEX += 1 )) - done - - fi - - eval "${GLOBAL_PROG_REFERENCE}" < "${GLOBAL_TMP_DIRECTORY}/stdin" 1> "${RESPONSE_REFERENCE_STDOUT}.raw" 2> "${RESPONSE_REFERENCE_STDERR}.raw" - SUBSHELL_EXIT_STATUS=${?} - - - if [ -f "${TEST}/after_exec" ] - then - - local INDEX=0 - local TOTAL=$(${AWK_PATH} 'END {print NR+1}' "${TEST}/after_exec") - while [ "$INDEX" -le "$TOTAL" ] - do - eval $(${AWK_PATH} -v INDEX="${INDEX}" 'NR == INDEX {print $0; exit}' "${TEST}/after_exec") - (( INDEX += 1 )) - done - - fi - - exit "${SUBSHELL_EXIT_STATUS}" - ) - REFERENCE_EXIT_STATUS=${?} - - awk '{gsub(/\033\[[0-9;]*m/, ""); print}' "${RESPONSE_REFERENCE_STDOUT}.raw" > "${RESPONSE_REFERENCE_STDOUT}" - awk '{gsub(/\033\[[0-9;]*m/, ""); print}' "${RESPONSE_REFERENCE_STDERR}.raw" > "${RESPONSE_REFERENCE_STDERR}" - fi - - if [ -f "${TEST}/stdout" ] - then - RUN_ASSERT="0" - if [ "${GLOBAL_PROG_REFERENCE}" != "" ] - then - run_assert "REFERENCE_" "STDOUT" 1>- 2>- - RUN_ASSERT="${?}" - fi - if [ "${RUN_ASSERT}" == "0" ] - then - LOG_CURRENT_TEST_STDOUT="$(run_assert "" "STDOUT")" - ASSERT_STATUS="${?}" - if [ "${ASSERT_STATUS}" != "0" ] - then - [ "${TEST_STATUS}" == "0" -o "${TEST_STATUS}" == "2" ] && TEST_STATUS="${ASSERT_STATUS}" - fi - RUN_TEST=1 - fi - fi - - if [ -f "${TEST}/stderr" ] - then - RUN_ASSERT="0" - if [ "${GLOBAL_PROG_REFERENCE}" != "" ] - then - run_assert "REFERENCE_" "STDERR" 1>- 2>- - RUN_ASSERT="${?}" - fi - if [ "${RUN_ASSERT}" == "0" ] - then - LOG_CURRENT_TEST_STDERR="$(run_assert "" "STDERR")" - ASSERT_STATUS="${?}" - if [ "${ASSERT_STATUS}" != "0" ] - then - [ "${TEST_STATUS}" == "0" -o "${TEST_STATUS}" == "2" ] && TEST_STATUS="${ASSERT_STATUS}" - fi - RUN_TEST=1 - fi - fi - - if [ -f "${TEST}/misc" ] - then - RUN_ASSERT="0" - if [ "${GLOBAL_PROG_REFERENCE}" != "" ] - then - run_assert "REFERENCE_" "MISC" 1>- 2>- - RUN_ASSERT="${?}" - fi - if [ "${RUN_ASSERT}" == "0" ] - then - LOG_CURRENT_TEST_MISC="$(run_assert "" "MISC")" - ASSERT_STATUS="${?}" - if [ "${ASSERT_STATUS}" != "0" ] - then - [ "${TEST_STATUS}" == "0" -o "${TEST_STATUS}" == "2" ] && TEST_STATUS="${ASSERT_STATUS}" - fi - RUN_TEST=1 - fi - fi - - - if [ "${RUN_TEST}" == "1" ] - then - (( GLOBAL_TOTAL_TESTS = GLOBAL_TOTAL_TESTS + 1 )) - - if [ "${TEST_STATUS}" != "0" -o "${GLOBAL_SHOW_SUCCESS}" == "1" ] - then - GLOBAL_LOG="$(printf "%s\n\n%s\n\n${C_BOLD}%s${C_CLEAR}" "${GLOBAL_LOG}" "----------------------------------------------------------------" "${LOG_CURRENT_TEST}")" - case "${TEST_STATUS}" in - 0) GLOBAL_LOG="$(printf "%s ${C_GREEN}%s${C_CLEAR}" "${GLOBAL_LOG}" "(SUCCESS)")" ;; - 1) GLOBAL_LOG="$(printf "%s ${C_RED}%s${C_CLEAR}" "${GLOBAL_LOG}" "(FAILED)")" ;; - 2) GLOBAL_LOG="$(printf "%s ${C_YELLOW}%s${C_CLEAR}" "${GLOBAL_LOG}" "(WARNING)")" ;; - 255) GLOBAL_LOG="$(printf "%s ${C_RED}%s${C_CLEAR}" "${GLOBAL_LOG}" "(RUNTIME ERROR)")" ;; - esac - [ -f "${TEST}/description" ] && GLOBAL_LOG="$(printf "%s\n\n Description:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk '{printf " %s\n", $0}' "${TEST}/description")")" - - [ -f "${TEST}/before_exec" ] && GLOBAL_LOG="$(printf "%s\n\n Before test:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk -v GLOBAL_TOKEN="${GLOBAL_TOKEN}" -v GLOBAL_INSTALLDIR="${GLOBAL_INSTALLDIR}" -v GLOBAL_TMP_DIRECTORY="${GLOBAL_TMP_DIRECTORY}" -v PATH="${PATH}" -v HOME="${HOME}" '{gsub(/\$\{GLOBAL_TOKEN\}/, GLOBAL_TOKEN); gsub(/\$\{GLOBAL_INSTALLDIR\}/, GLOBAL_INSTALLDIR); gsub(/\$\{GLOBAL_TMP_DIRECTORY\}/, GLOBAL_TMP_DIRECTORY); gsub(/\$\{PATH\}/, PATH); gsub(/\$\{HOME\}/, HOME); printf " %02s: %s\n", NR, $0}' "${TEST}/before_exec")")" - - GLOBAL_LOG="$(printf " %s\n\n STDIN:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk '{printf " %02s: %s\n", NR, $0}' "${GLOBAL_TMP_DIRECTORY}/stdin")")" - - if [ "${LOG_CURRENT_TEST_STDOUT}" != "" ] - then - GLOBAL_LOG="$(printf "%s\n\n STDOUT:\n%s\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "${LOG_CURRENT_TEST_STDOUT}" "$(awk '{printf " %02s: %s\n", NR, $0} END {if (NR==0) { print " (no output)" }}' "${RESPONSE_STDOUT}")")" - else - GLOBAL_LOG="$(printf "%s\n\n STDOUT:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk '{printf " %02s: %s\n", NR, $0} END {if (NR==0) { print " (no output)" }}' "${RESPONSE_STDOUT}")")" - fi - - if [ "${LOG_CURRENT_TEST_STDERR}" != "" ] - then - GLOBAL_LOG="$(printf "%s\n\n STDERR:\n%s\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "${LOG_CURRENT_TEST_STDERR}" "$(awk '{printf " %02s: %s\n", NR, $0} END {if (NR==0) { print " (no output)" }}' "${RESPONSE_STDERR}")")" - else - GLOBAL_LOG="$(printf "%s\n\n STDERR:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk '{printf " %02s: %s\n", NR, $0} END {if (NR==0) { print " (no output)" }}' "${RESPONSE_STDERR}")")" - fi - - [ "${LOG_CURRENT_TEST_MISC}" != "" ] && GLOBAL_LOG="$(printf "%s\n\n MISC:\n%s" "${GLOBAL_LOG}" "${LOG_CURRENT_TEST_MISC}")" - - [ -f "${TEST}/after_exec" ] && GLOBAL_LOG="$(printf "%s\n\n After test:\n${C_GREY}%s${C_CLEAR}" "${GLOBAL_LOG}" "$(awk -v GLOBAL_TOKEN="${GLOBAL_TOKEN}" -v GLOBAL_INSTALLDIR="${GLOBAL_INSTALLDIR}" -v GLOBAL_TMP_DIRECTORY="${GLOBAL_TMP_DIRECTORY}" -v PATH="${PATH}" -v HOME="${HOME}" '{gsub(/\$\{GLOBAL_TOKEN\}/, GLOBAL_TOKEN); gsub(/\$\{GLOBAL_INSTALLDIR\}/, GLOBAL_INSTALLDIR); gsub(/\$\{GLOBAL_TMP_DIRECTORY\}/, GLOBAL_TMP_DIRECTORY); gsub(/\$\{PATH\}/, PATH); gsub(/\$\{HOME\}/, HOME); printf " %02s: %s\n", NR, $0}' "${TEST}/after_exec")")" - - [ "${TEST_STATUS}" == "1" ] && (( GLOBAL_TOTAL_FAILED_TESTS = GLOBAL_TOTAL_FAILED_TESTS + 1 )) - fi - - case "${TEST_STATUS}" in - 0) printf "${C_GREEN}.${C_CLEAR}" ;; - 1) printf "${C_RED}x${C_CLEAR}" ;; - 2) printf "${C_YELLOW}~${C_CLEAR}" ;; - 255) printf "${C_RED}!${C_CLEAR}" ;; - esac - fi - - fi - done - IFS="${OLD_IFS}" -} diff --git a/42sh/42ShellTester/lib/verbs/be_empty.sh b/42sh/42ShellTester/lib/verbs/be_empty.sh deleted file mode 100644 index 81d091ef..00000000 --- a/42sh/42ShellTester/lib/verbs/be_empty.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# /* -# Test emptiness of output -# RESPONSE -> actual output (stdout or stderr) -# */ - -run_verb_be_empty() -{ - if [ "$(awk '{print}' "${RESPONSE}")" == "" ] - then - return 0 - else - return 1 - fi -} diff --git a/42sh/42ShellTester/lib/verbs/create_file.sh b/42sh/42ShellTester/lib/verbs/create_file.sh deleted file mode 100644 index 127e3eaa..00000000 --- a/42sh/42ShellTester/lib/verbs/create_file.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# /* -# Test file creation -# EXPECTED_TO_ARGS[0]* -> expected file path -# EXPECTED_TO_ARGS[1] -> file test (with_regexp, without_regexp, with_nb_of_lines) -# EXPECTED_TO_ARGS[2] -> argument of file test -# */ - -run_verb_create_file() -{ - if [ -f "${EXPECTED_TO_ARGS[0]}" ] - then - if [ "${EXPECTED_TO_ARGS[1]}" == "" ] - then - return 0 - else - case "${EXPECTED_TO_ARGS[1]}" in - matching_regex) - if [ "$(awk -v regexp="${EXPECTED_TO_ARGS[2]}" '$0 ~ regexp {print}' "${EXPECTED_TO_ARGS[0]}")" == "" ] - then - return 1 - else - return 0 - fi ;; - not_matching_regex) - if [ "$(awk -v regexp="${EXPECTED_TO_ARGS[2]}" '$0 ~ regexp {print}' "${EXPECTED_TO_ARGS[0]}")" == "" ] - then - return 0 - else - return 1 - fi ;; - with_nb_of_lines) - if [ "$(awk 'END {print NR}' "${EXPECTED_TO_ARGS[0]}")" == "${EXPECTED_TO_ARGS[2]}" ] - then - return 0 - else - return 1 - fi ;; - *) - return 255 ;; - esac - fi - else - return 1 - fi -} diff --git a/42sh/42ShellTester/lib/verbs/exit_with_status.sh b/42sh/42ShellTester/lib/verbs/exit_with_status.sh deleted file mode 100644 index 062e17f1..00000000 --- a/42sh/42ShellTester/lib/verbs/exit_with_status.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# /* -# Test exit status -# EXPECTED_TO_ARGS[0]* -> expected exit status (integer) -# RESPONSE_EXIT_STATUS -> actual exit status -# */ - -run_verb_exit_with_status() -{ - if [ "${RESPONSE_EXIT_STATUS}" == "${EXPECTED_TO_ARGS[0]}" ] - then - return 0 - else - return 1 - fi -} diff --git a/42sh/42ShellTester/lib/verbs/have_nb_of_lines.sh b/42sh/42ShellTester/lib/verbs/have_nb_of_lines.sh deleted file mode 100644 index b7571838..00000000 --- a/42sh/42ShellTester/lib/verbs/have_nb_of_lines.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# /* -# Test number of output lines -# EXPECTED_TO_ARGS[0]* -> expected number of lines (integer) -# RESPONSE -> actual output (stdout or stderr) -# */ - -run_verb_have_nb_of_lines() -{ - if [ "$(awk 'END {printf NR}' "${RESPONSE}")" == "${EXPECTED_TO_ARGS[0]}" ] - then - return 0 - else - return 1 - fi -} diff --git a/42sh/42ShellTester/lib/verbs/match_each_regex_of_file.sh b/42sh/42ShellTester/lib/verbs/match_each_regex_of_file.sh deleted file mode 100644 index 17569d4a..00000000 --- a/42sh/42ShellTester/lib/verbs/match_each_regex_of_file.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# /* -# Multiple test regular expression -# EXPECTED_TO_ARGS[0]* -> file path that stores expected regular expression -# RESPONSE -> actual output (stdout or stderr) -# */ - -run_verb_match_each_regex_of_file() -{ - local INDEX=0 ERROR=0 TOTAL LINE - TOTAL=$(awk 'END {print NR+1}' "${EXPECTED_TO_ARGS[0]}") - while [ "${INDEX}" -le "${TOTAL}" ] - do - LINE="$(awk -v INDEX="${INDEX}" 'NR == INDEX {print; exit}' "${EXPECTED_TO_ARGS[0]}")" - if [ "$(awk -v regexp="${LINE}" '$0 ~ regexp {print}' "${RESPONSE}")" == "" ] - then - ERROR=1 - fi - (( INDEX += 1 )) - done - if [ ${ERROR} -eq 1 ] - then - return 1 - else - return 0 - fi -} diff --git a/42sh/42ShellTester/lib/verbs/match_regex.sh b/42sh/42ShellTester/lib/verbs/match_regex.sh deleted file mode 100644 index 2c9e8b92..00000000 --- a/42sh/42ShellTester/lib/verbs/match_regex.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# /* -# Test regular expression -# EXPECTED_TO_ARGS[0]* -> expected regular expression match -# EXPECTED_TO_ARGS[1]* -> value 'once' or if next argument is value 'times', the number of times -# RESPONSE -> actual output (stdout or stderr) -# */ - -run_verb_match_regex() -{ - local NB_OF_TIMES="0" RESULT - if [ "${EXPECTED_TO_ARGS[1]}" == "once" ] - then - NB_OF_TIMES="1" - fi - if [ "${EXPECTED_TO_ARGS[2]}" == "times" ] - then - NB_OF_TIMES="${EXPECTED_TO_ARGS[1]}" - fi - RESULT="$(awk -v regexp="${EXPECTED_TO_ARGS[0]}" 'BEGIN {TOTAL=0} $0 ~ regexp {TOTAL++} END {printf TOTAL}' "${RESPONSE}")" - if [ "${NB_OF_TIMES}" == "0" ] - then - if [ "${RESULT}" != "0" ] - then - return 0 - else - return 1 - fi - else - if [ "${RESULT}" == "${NB_OF_TIMES}" ] - then - return 0 - else - return 1 - fi - fi -} diff --git a/42sh/42ShellTester/log b/42sh/42ShellTester/log deleted file mode 100644 index 89d7badb..00000000 --- a/42sh/42ShellTester/log +++ /dev/null @@ -1,346 +0,0 @@ -...x...~......xx....~...~.....~.....~.....~........... - ----------------------------------------------------------------- - -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 "TOKEN201703252056" - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703252056` - (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.h7gvN9K1go/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 11: ZSH=/Users/ariard/.oh-my-zsh - 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners - 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,23758,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=%21 - 26: XPC_SERVICE_NAME=0 - 27: SHLVL=4 - 28: HOME=/Users/ariard - 29: COLORFGBG=7;0 - 30: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 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.h7gvN9K1go/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 11: ZSH=/Users/ariard/.oh-my-zsh - 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners - 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,23758,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=%21 - 26: XPC_SERVICE_NAME=0 - 27: SHLVL=4 - 28: HOME=/Users/ariard - 29: COLORFGBG=7;0 - 30: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 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 : ./not_a_directory: 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 : ./symbolic_link1: No such file or directory - ----------------------------------------------------------------- - -minishell/builtins/cd/options/001-not-following-links (WARNING) - - 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/42ShellTester/tmp/display_env - - STDOUT: - SUCCESS expected_to match_regex `PWD=/Users/ariard/Projects/42sh/42ShellTester/tmp/sub_directory/sub_sub_directory` - 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.h7gvN9K1go/Render - 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 10: ZSH=/Users/ariard/.oh-my-zsh - 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1T0c86pYlP/Listeners - 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,23758,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/sub_directory/sub_sub_directory - 21: LANG=en_US.UTF-8 - 22: ITERM_PROFILE=Default - 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%21 - 25: XPC_SERVICE_NAME=0 - 26: SHLVL=4 - 27: HOME=/Users/ariard - 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:D7FAE8F0-DDCC-428E-AC84-622B27EDC123 - 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: ?=73 - 37: ------------------------------ - 38: TOTAL ENVIRONMENT VARIABLES: 35 - - STDERR: - WARNING might be_empty - 01: ../../42sh: cd : ./sub_directory_link: Symlink not resolved - 02: ../../42sh: cd : ./sub_sub_directory_link: Symlink not resolved - ----------------------------------------------------------------- - -minishell/builtins/env/errors/001-command-not-found (WARNING) - - 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: - SUCCESS expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/exit/errors/001-too-many-args (WARNING) - - 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 TOKEN201703252056 - - STDOUT: - SUCCESS expected_to match_regex `TOKEN201703252056` - 01: TOKEN201703252056 - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `([Tt]oo many arguments|[Aa]rgument list too long)` - 01: ../../42sh: exit: too many argument required - - MISC: - SUCCESS expected_to exit_with_status `0` - -Total tests: 54 -Total failed tests: 3 -Total pending tests: 0 diff --git a/42sh/42ShellTester/minishell_error b/42sh/42ShellTester/minishell_error deleted file mode 100644 index 5ace4e58..00000000 --- a/42sh/42ShellTester/minishell_error +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/42sh/42ShellTester/spec/README.md b/42sh/42ShellTester/spec/README.md deleted file mode 100644 index dba95403..00000000 --- a/42sh/42ShellTester/spec/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# spec - -* [21sh](./21sh) -* [42sh](./42sh) -* [bonuses](./bonuses) -* [minishell](./minishell) diff --git a/42sh/42ShellTester/spec/minishell_error b/42sh/42ShellTester/spec/minishell_error deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/42ShellTester/support/Makefile b/42sh/42ShellTester/support/Makefile deleted file mode 100644 index f8aeae9c..00000000 --- a/42sh/42ShellTester/support/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -TARGET_DIR=../../tmp - -all: - make TARGET_DIR=$(TARGET_DIR) -C ./display-env - make TARGET_DIR=$(TARGET_DIR) -C ./display-program-name - make TARGET_DIR=$(TARGET_DIR) -C ./display-pwd - make TARGET_DIR=$(TARGET_DIR) -C ./exit-with-status - make TARGET_DIR=$(TARGET_DIR) -C ./read-on-stdin - make TARGET_DIR=$(TARGET_DIR) -C ./sleep-and-exit-with-status - make TARGET_DIR=$(TARGET_DIR) -C ./sleep-and-write-on-stderr - make TARGET_DIR=$(TARGET_DIR) -C ./write-all-arguments-on-stdout - 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 - -re: fclean all - -fclean: - make TARGET_DIR=$(TARGET_DIR) fclean -C ./display-env - make TARGET_DIR=$(TARGET_DIR) fclean -C ./display-program-name - make TARGET_DIR=$(TARGET_DIR) fclean -C ./display-pwd - make TARGET_DIR=$(TARGET_DIR) fclean -C ./exit-with-status - make TARGET_DIR=$(TARGET_DIR) fclean -C ./read-on-stdin - make TARGET_DIR=$(TARGET_DIR) fclean -C ./sleep-and-exit-with-status - 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 ./write-on-stdout - make TARGET_DIR=$(TARGET_DIR) fclean -C ./write-on-stdout-and-stderr diff --git a/42sh/42ShellTester/support/display-env/Makefile b/42sh/42ShellTester/support/display-env/Makefile deleted file mode 100644 index d2691951..00000000 --- a/42sh/42ShellTester/support/display-env/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=display_env -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/42ShellTester/support/display-env/README.md b/42sh/42ShellTester/support/display-env/README.md deleted file mode 100644 index 3b363278..00000000 --- a/42sh/42ShellTester/support/display-env/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# ./display_env - -A binary that iterates on `**envp` and write each element on standard output. - -```c -#include -#include -#include - -int main(int argc, char **argv, char **envp) -{ - int i; - - i = 0; - (void)argc; - (void)argv; - write(1, "------------------------------\n", 31); - while (envp[i]) - { - write(1, envp[i], strlen(envp[i])); - write(1, "\n", 1); - i++; - } - write(1, "------------------------------\n", 31); - printf("TOTAL ENVIRONMENT VARIABLES: %d\n", i); - return (0); -} -``` diff --git a/42sh/42ShellTester/support/display-env/description b/42sh/42ShellTester/support/display-env/description deleted file mode 100644 index 8ea7d9c4..00000000 --- a/42sh/42ShellTester/support/display-env/description +++ /dev/null @@ -1 +0,0 @@ -A binary that iterates on `**envp` and write each element on standard output. diff --git a/42sh/42ShellTester/support/display-env/main.c b/42sh/42ShellTester/support/display-env/main.c deleted file mode 100644 index 95bfa3a1..00000000 --- a/42sh/42ShellTester/support/display-env/main.c +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv, char **envp) -{ - int i; - - i = 0; - (void)argc; - (void)argv; - write(1, "------------------------------\n", 31); - while (envp[i]) - { - write(1, envp[i], strlen(envp[i])); - write(1, "\n", 1); - i++; - } - write(1, "------------------------------\n", 31); - printf("TOTAL ENVIRONMENT VARIABLES: %d\n", i); - return (0); -} diff --git a/42sh/42ShellTester/support/display-program-name/Makefile b/42sh/42ShellTester/support/display-program-name/Makefile deleted file mode 100644 index 6cf460d1..00000000 --- a/42sh/42ShellTester/support/display-program-name/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=display_program_name -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/42ShellTester/support/display-program-name/README.md b/42sh/42ShellTester/support/display-program-name/README.md deleted file mode 100644 index 54fba524..00000000 --- a/42sh/42ShellTester/support/display-program-name/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# ./display_program_name - -A binary that writes its name on standard ouput. - -```c -#include -#include - -int main(int ac, char **av) -{ - (void)ac; - write(1, av[0], strlen(av[0])); - write(1, "\n", 1); - return (0); -} -``` diff --git a/42sh/42ShellTester/support/display-program-name/description b/42sh/42ShellTester/support/display-program-name/description deleted file mode 100644 index 67f56943..00000000 --- a/42sh/42ShellTester/support/display-program-name/description +++ /dev/null @@ -1 +0,0 @@ -A binary that writes its name on standard ouput. diff --git a/42sh/42ShellTester/support/display-program-name/main.c b/42sh/42ShellTester/support/display-program-name/main.c deleted file mode 100644 index 3c3d8c9b..00000000 --- a/42sh/42ShellTester/support/display-program-name/main.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main(int ac, char **av) -{ - (void)ac; - write(1, av[0], strlen(av[0])); - write(1, "\n", 1); - return (0); -} diff --git a/42sh/42ShellTester/support/display-pwd/Makefile b/42sh/42ShellTester/support/display-pwd/Makefile deleted file mode 100644 index 3f67de1c..00000000 --- a/42sh/42ShellTester/support/display-pwd/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=display_pwd -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/42ShellTester/support/display-pwd/README.md b/42sh/42ShellTester/support/display-pwd/README.md deleted file mode 100644 index 6f1a2b1f..00000000 --- a/42sh/42ShellTester/support/display-pwd/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# ./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`. - -```c -#include -#include - -int main(void) -{ - char *pwd; - - pwd = getcwd(NULL, 0); - write(1, "PWD:", 4); - write(1, pwd, strlen(pwd)); - write(1, ":PWD\n", 5); - return (0); -} -``` diff --git a/42sh/42ShellTester/support/display-pwd/description b/42sh/42ShellTester/support/display-pwd/description deleted file mode 100644 index 3ed81da3..00000000 --- a/42sh/42ShellTester/support/display-pwd/description +++ /dev/null @@ -1 +0,0 @@ -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`. diff --git a/42sh/42ShellTester/support/display-pwd/main.c b/42sh/42ShellTester/support/display-pwd/main.c deleted file mode 100644 index 4577602e..00000000 --- a/42sh/42ShellTester/support/display-pwd/main.c +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -int main(void) -{ - char *pwd; - - pwd = getcwd(NULL, 0); - write(1, "PWD:", 4); - write(1, pwd, strlen(pwd)); - write(1, ":PWD\n", 5); - return (0); -} diff --git a/42sh/42ShellTester/support/exit-with-status/Makefile b/42sh/42ShellTester/support/exit-with-status/Makefile deleted file mode 100644 index ff89498a..00000000 --- a/42sh/42ShellTester/support/exit-with-status/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=exit_with_status -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/42ShellTester/support/exit-with-status/README.md b/42sh/42ShellTester/support/exit-with-status/README.md deleted file mode 100644 index 03ff819a..00000000 --- a/42sh/42ShellTester/support/exit-with-status/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# ./exit_with_status - -A binary that immediately exits with the status given as first argument. - -```c -#include - -int main(int argc, char **argv) -{ - (void)argc; - if (argc == 2) - return (atoi(argv[1])); - return (0); -} -``` diff --git a/42sh/42ShellTester/support/exit-with-status/description b/42sh/42ShellTester/support/exit-with-status/description deleted file mode 100644 index cc796af3..00000000 --- a/42sh/42ShellTester/support/exit-with-status/description +++ /dev/null @@ -1 +0,0 @@ -A binary that immediately exits with the status given as first argument. diff --git a/42sh/42ShellTester/support/exit-with-status/main.c b/42sh/42ShellTester/support/exit-with-status/main.c deleted file mode 100644 index b79772e5..00000000 --- a/42sh/42ShellTester/support/exit-with-status/main.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int main(int argc, char **argv) -{ - (void)argc; - if (argc == 2) - return (atoi(argv[1])); - return (0); -} diff --git a/42sh/42ShellTester/support/read-on-stdin/Makefile b/42sh/42ShellTester/support/read-on-stdin/Makefile deleted file mode 100644 index 4cf56248..00000000 --- a/42sh/42ShellTester/support/read-on-stdin/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=read_on_stdin -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/42ShellTester/support/read-on-stdin/README.md b/42sh/42ShellTester/support/read-on-stdin/README.md deleted file mode 100644 index 69399bf0..00000000 --- a/42sh/42ShellTester/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/42ShellTester/support/read-on-stdin/description b/42sh/42ShellTester/support/read-on-stdin/description deleted file mode 100644 index e5f02ab5..00000000 --- a/42sh/42ShellTester/support/read-on-stdin/description +++ /dev/null @@ -1 +0,0 @@ -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. diff --git a/42sh/42ShellTester/support/read-on-stdin/main.c b/42sh/42ShellTester/support/read-on-stdin/main.c deleted file mode 100644 index 1bbe6af9..00000000 --- a/42sh/42ShellTester/support/read-on-stdin/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#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/42ShellTester/support/sleep-and-exit-with-status/Makefile b/42sh/42ShellTester/support/sleep-and-exit-with-status/Makefile deleted file mode 100644 index c73f1aed..00000000 --- a/42sh/42ShellTester/support/sleep-and-exit-with-status/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=sleep_and_exit_with_status -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/42ShellTester/support/sleep-and-exit-with-status/README.md b/42sh/42ShellTester/support/sleep-and-exit-with-status/README.md deleted file mode 100644 index 1fd5254f..00000000 --- a/42sh/42ShellTester/support/sleep-and-exit-with-status/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# ./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. - -```c -#include -#include -#include - -int main(int argc, char **argv) -{ - int seconds; - - seconds = 1; - if (argc > 1) - seconds = atoi(argv[1]); - sleep(seconds); - if (argc > 2) - return (atoi(argv[2])); - return (0); -} -``` diff --git a/42sh/42ShellTester/support/sleep-and-exit-with-status/description b/42sh/42ShellTester/support/sleep-and-exit-with-status/description deleted file mode 100644 index 0717f2fd..00000000 --- a/42sh/42ShellTester/support/sleep-and-exit-with-status/description +++ /dev/null @@ -1 +0,0 @@ -A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument. diff --git a/42sh/42ShellTester/support/sleep-and-exit-with-status/main.c b/42sh/42ShellTester/support/sleep-and-exit-with-status/main.c deleted file mode 100644 index 32f90c46..00000000 --- a/42sh/42ShellTester/support/sleep-and-exit-with-status/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv) -{ - int seconds; - - seconds = 1; - if (argc > 1) - seconds = atoi(argv[1]); - sleep(seconds); - if (argc > 2) - return (atoi(argv[2])); - return (0); -} diff --git a/42sh/42ShellTester/support/sleep-and-write-on-stderr/Makefile b/42sh/42ShellTester/support/sleep-and-write-on-stderr/Makefile deleted file mode 100644 index 39311aca..00000000 --- a/42sh/42ShellTester/support/sleep-and-write-on-stderr/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=sleep_and_write_on_stderr -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/42ShellTester/support/sleep-and-write-on-stderr/README.md b/42sh/42ShellTester/support/sleep-and-write-on-stderr/README.md deleted file mode 100644 index 5ce004e5..00000000 --- a/42sh/42ShellTester/support/sleep-and-write-on-stderr/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# ./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. - -```c -#include -#include -#include - -int main(int argc, char **argv) -{ - int seconds; - - seconds = 1; - if (argc > 1) - seconds = atoi(argv[1]); - sleep(seconds); - if (argc > 2) - { - write(2, argv[2], strlen(argv[2])); - } - return (0); -} -``` diff --git a/42sh/42ShellTester/support/sleep-and-write-on-stderr/description b/42sh/42ShellTester/support/sleep-and-write-on-stderr/description deleted file mode 100644 index a4852ae2..00000000 --- a/42sh/42ShellTester/support/sleep-and-write-on-stderr/description +++ /dev/null @@ -1 +0,0 @@ -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. diff --git a/42sh/42ShellTester/support/sleep-and-write-on-stderr/main.c b/42sh/42ShellTester/support/sleep-and-write-on-stderr/main.c deleted file mode 100644 index b9c77a68..00000000 --- a/42sh/42ShellTester/support/sleep-and-write-on-stderr/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv) -{ - int seconds; - - seconds = 1; - if (argc > 1) - seconds = atoi(argv[1]); - sleep(seconds); - if (argc > 2) - { - write(2, argv[2], strlen(argv[2])); - } - return (0); -} diff --git a/42sh/42ShellTester/support/write-all-arguments-on-stdout/Makefile b/42sh/42ShellTester/support/write-all-arguments-on-stdout/Makefile deleted file mode 100644 index 2ef23814..00000000 --- a/42sh/42ShellTester/support/write-all-arguments-on-stdout/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=write_all_arguments_on_stdout -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/42ShellTester/support/write-all-arguments-on-stdout/README.md b/42sh/42ShellTester/support/write-all-arguments-on-stdout/README.md deleted file mode 100644 index 0dc66c74..00000000 --- a/42sh/42ShellTester/support/write-all-arguments-on-stdout/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# ./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". - -```c -#include -#include - -int main(int argc, char **argv) -{ - if (argc >= 2) - { - argv++; - while (*argv) - { - write(1, *argv, strlen(*argv)); - write(1, "@", 1); - argv++; - } - write(1, "\n", 1); - } - else - { - write(1, "nothing to be written on stdout\n", 32); - } - return (0); -} -``` diff --git a/42sh/42ShellTester/support/write-all-arguments-on-stdout/description b/42sh/42ShellTester/support/write-all-arguments-on-stdout/description deleted file mode 100644 index 5e8a8ec3..00000000 --- a/42sh/42ShellTester/support/write-all-arguments-on-stdout/description +++ /dev/null @@ -1 +0,0 @@ -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". diff --git a/42sh/42ShellTester/support/write-all-arguments-on-stdout/main.c b/42sh/42ShellTester/support/write-all-arguments-on-stdout/main.c deleted file mode 100644 index f274e832..00000000 --- a/42sh/42ShellTester/support/write-all-arguments-on-stdout/main.c +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - if (argc >= 2) - { - argv++; - while (*argv) - { - write(1, *argv, strlen(*argv)); - write(1, "@", 1); - argv++; - } - write(1, "\n", 1); - } - else - { - write(1, "nothing to be written on stdout\n", 32); - } - return (0); -} diff --git a/42sh/42ShellTester/support/write-on-stderr/Makefile b/42sh/42ShellTester/support/write-on-stderr/Makefile deleted file mode 100644 index a754e806..00000000 --- a/42sh/42ShellTester/support/write-on-stderr/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=write_on_stderr -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/42ShellTester/support/write-on-stderr/README.md b/42sh/42ShellTester/support/write-on-stderr/README.md deleted file mode 100644 index 6a704fb8..00000000 --- a/42sh/42ShellTester/support/write-on-stderr/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# ./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`. - -```c -#include -#include -#include - -int main(int argc, char **argv) -{ - if (argc > 1) - { - write(2, argv[1], strlen(argv[1])); - write(2, "\n", 1); - } - else - { - write(2, "write on stderr\n", 16); - } - if (argc == 3) - return (atoi(argv[2])); - return (1); -} -``` diff --git a/42sh/42ShellTester/support/write-on-stderr/description b/42sh/42ShellTester/support/write-on-stderr/description deleted file mode 100644 index 3095b703..00000000 --- a/42sh/42ShellTester/support/write-on-stderr/description +++ /dev/null @@ -1 +0,0 @@ -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`. diff --git a/42sh/42ShellTester/support/write-on-stderr/main.c b/42sh/42ShellTester/support/write-on-stderr/main.c deleted file mode 100644 index 2c917f48..00000000 --- a/42sh/42ShellTester/support/write-on-stderr/main.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv) -{ - if (argc > 1) - { - write(2, argv[1], strlen(argv[1])); - write(2, "\n", 1); - } - else - { - write(2, "write on stderr\n", 16); - } - if (argc == 3) - return (atoi(argv[2])); - return (1); -} diff --git a/42sh/42ShellTester/support/write-on-stdout-and-stderr/Makefile b/42sh/42ShellTester/support/write-on-stdout-and-stderr/Makefile deleted file mode 100644 index d10c9daf..00000000 --- a/42sh/42ShellTester/support/write-on-stdout-and-stderr/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=write_on_stdout_and_stderr -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/42ShellTester/support/write-on-stdout-and-stderr/README.md b/42sh/42ShellTester/support/write-on-stdout-and-stderr/README.md deleted file mode 100644 index a0460a0d..00000000 --- a/42sh/42ShellTester/support/write-on-stdout-and-stderr/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# ./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". - -```c -#include -#include - -int main(int argc, char **argv) -{ - if (argc == 3) - { - write(1, argv[1], strlen(argv[1])); - write(1, "\n", 1); - write(2, argv[2], strlen(argv[2])); - write(2, "\n", 1); - } - else - { - write(1, "write on stdout\n", 16); - write(2, "write on stderr\n", 16); - } - return (0); -} -``` diff --git a/42sh/42ShellTester/support/write-on-stdout-and-stderr/description b/42sh/42ShellTester/support/write-on-stdout-and-stderr/description deleted file mode 100644 index d5e369af..00000000 --- a/42sh/42ShellTester/support/write-on-stdout-and-stderr/description +++ /dev/null @@ -1 +0,0 @@ -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/42ShellTester/support/write-on-stdout-and-stderr/main.c b/42sh/42ShellTester/support/write-on-stdout-and-stderr/main.c deleted file mode 100644 index 96058cdc..00000000 --- a/42sh/42ShellTester/support/write-on-stdout-and-stderr/main.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - if (argc == 3) - { - write(1, argv[1], strlen(argv[1])); - write(1, "\n", 1); - write(2, argv[2], strlen(argv[2])); - write(2, "\n", 1); - } - else - { - write(1, "write on stdout\n", 16); - write(2, "write on stderr\n", 16); - } - return (0); -} diff --git a/42sh/42ShellTester/support/write-on-stdout/Makefile b/42sh/42ShellTester/support/write-on-stdout/Makefile deleted file mode 100644 index 741b593b..00000000 --- a/42sh/42ShellTester/support/write-on-stdout/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -NAME=write_on_stdout -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/42ShellTester/support/write-on-stdout/README.md b/42sh/42ShellTester/support/write-on-stdout/README.md deleted file mode 100644 index 978d1326..00000000 --- a/42sh/42ShellTester/support/write-on-stdout/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# ./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". - -```c -#include -#include - -int main(int argc, char **argv) -{ - if (argc == 2) - { - write(1, argv[1], strlen(argv[1])); - write(1, "\n", 1); - } - else - { - write(1, "write on stdout\n", 16); - } - return (0); -} -``` diff --git a/42sh/42ShellTester/support/write-on-stdout/description b/42sh/42ShellTester/support/write-on-stdout/description deleted file mode 100644 index 69367f59..00000000 --- a/42sh/42ShellTester/support/write-on-stdout/description +++ /dev/null @@ -1 +0,0 @@ -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". diff --git a/42sh/42ShellTester/support/write-on-stdout/main.c b/42sh/42ShellTester/support/write-on-stdout/main.c deleted file mode 100644 index eb342002..00000000 --- a/42sh/42ShellTester/support/write-on-stdout/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - if (argc == 2) - { - write(1, argv[1], strlen(argv[1])); - write(1, "\n", 1); - } - else - { - write(1, "write on stdout\n", 16); - } - return (0); -} diff --git a/42sh/42ShellTester/tasks/generate_readmes.sh b/42sh/42ShellTester/tasks/generate_readmes.sh deleted file mode 100644 index 0f572155..00000000 --- a/42sh/42ShellTester/tasks/generate_readmes.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/bash - -GLOBAL_INSTALLDIR="$(pwd)" -GLOBAL_TMP_DIRECTORY="${GLOBAL_INSTALLDIR}/tmp" -GLOBAL_LOCALBRANCH=$(git branch | awk '$0 ~ /^\*/ {print $2; exit}') -GLOBAL_LIST_OF_TESTS= -GLOBAL_TOTAL_TESTS=0 -GLOBAL_SUPPORT_BINARIES_LIST="" -GLOBAL_SUPPORT_BINARIES_LIST2="" - -if [ "${GLOBAL_LOCALBRANCH}" != "master" ] -then - printf "%s\n" "Task error: must be run in master branch to ensure pull requests to keep clean" - exit 1 -fi - -if [ -f "./tasks/${BASH_SOURCE[0]}" ] -then - printf "%s\n" "Task error: must be run from install directory" - exit 1 -fi - -run_create_support_binaries_readme() -{ - local SUPPORT_FILE - local README - local SUPPORT_FILE_NAME - - for SUPPORT_FILE in ./support/* - do - if [ -d "${SUPPORT_FILE}" ] - then - - README="${SUPPORT_FILE}/README.md" - SUPPORT_MAIN="${SUPPORT_FILE}/main.c" - SUPPORT_DESCRIPTION="${SUPPORT_FILE}/description" - SUPPORT_DIR_NAME="${SUPPORT_FILE##*/}" - SUPPORT_BINARY_NAME="${SUPPORT_DIR_NAME//-/_}" - - printf "# %s\n\n" "./${SUPPORT_BINARY_NAME}" >"${README}" - [ -f "${SUPPORT_DESCRIPTION}" ] && printf "%s\n\n" "$(cat "${SUPPORT_DESCRIPTION}")" >>"${README}" - printf "\`\`\`c\n%s\n\`\`\`\n" "$(cat "${SUPPORT_MAIN}")" >>"${README}" - - GLOBAL_SUPPORT_BINARIES_LIST="$(printf "%s\n%s" "${GLOBAL_SUPPORT_BINARIES_LIST}" "* **[./${SUPPORT_BINARY_NAME}](http://github.com/we-sh/42ShellTester/tree/master/support/${SUPPORT_DIR_NAME})** -> $(cat "${SUPPORT_DESCRIPTION}")")" - GLOBAL_SUPPORT_BINARIES_LIST2="${GLOBAL_SUPPORT_BINARIES_LIST2}\n\052 **[./${SUPPORT_BINARY_NAME}](http://github.com/we-sh/42ShellTester/tree/master/support/${SUPPORT_DIR_NAME})**: $(cat "${SUPPORT_DESCRIPTION}")" - - fi - done -} - -run_create_support_binaries_readme - -run_create_readme() -{ - local INDEX="${1}" - local TEST="${2}" - local TEST_NAME="${TEST##*/}" - local TEST_FULLNAME="${TEST##*spec/}" - local PARENT_DIR_NAME="${TEST%/*}" - local README="${TEST}/README.md" - - (( GLOBAL_TOTAL_TESTS= GLOBAL_TOTAL_TESTS + 1 )) - - printf "# %s\n\n" "${TEST_NAME}" >"${README}" - printf "*[%s](%s) > %s*\n\n" "${PARENT_DIR_NAME//\// > }" ".." "${DIR_NAME}" >>"${README}" - - if [ -f "${TEST}/description" ]; then cat "${TEST}/description" >>"${README}"; fi - - if [ -f "${TEST}/before_exec" ] - then - printf "### What is done before test\n\n\`\`\`bash\n" >>"${README}" - cat "${TEST}/before_exec" >>"${README}" - printf "\n\`\`\`\n\n" >>"${README}" - fi - - printf "### Shell commands that are sent to the standard entry\n\n\`\`\`bash\n" >>"${README}" - cat "${TEST}/stdin" >>"${README}" - printf "\n\`\`\`\n\n" >>"${README}" - - if [ -f "${TEST}/stdout" ] - then - printf "### What is expected on standard output\n\n\`\`\`bash\n" >>"${README}" - cat "${TEST}/stdout" >>"${README}" - printf "\n\`\`\`\n\n" >>"${README}" - fi - - if [ -f "${TEST}/stderr" ] - then - printf "### What is expected on error output\n\n\`\`\`bash\n" >>"${README}" - cat "${TEST}/stderr" >>"${README}" - printf "\n\`\`\`\n\n" >>"${README}" - fi - - if [ -f "${TEST}/misc" ] - then - printf "### What miscellaneous behaviors are expected\n\n\`\`\`bash\n" >>"${README}" - cat "${TEST}/misc" >>"${README}" - printf "\n\`\`\`\n\n" >>"${README}" - fi - - printf "### Variables\n\nThe following variables may appear in this test:\n\n" >>"${README}" - printf "* \${**GLOBAL_INSTALLDIR**} -> The installation directory of 42ShellTester\n" >>"${README}" - printf "* \${**GLOBAL_TMP_DIRECTORY**} -> The temporary directory in which tests are executed\n" >>"${README}" - printf "* \${**GLOBAL_TOKEN**} -> A token that changes value at launch time\n" >>"${README}" - printf "* \${**PATH**} -> The standard environment variable PATH\n" >>"${README}" - printf "* \${**HOME**} -> The standard environment variable HOME\n\n" >>"${README}" - - printf "### Support binaries\n\nThe following binaries may appear in this test:\n\n%s\n" "${GLOBAL_SUPPORT_BINARIES_LIST}" >>"${README}" -} - -run_browse_directory() -{ - local -i INDEX=${1} - local DIR="${2}" - local DIR_NAME="${DIR##*/}" - local DIR_FULLNAME="${DIR##*spec/}" - local PARENT_DIR_NAME="${DIR%/*}" - local README="${DIR}/README.md" - local SUBDIR - local IMGS="" - - if [ -f "${DIR}/stdin" ] - then - [ -f "${DIR}/non-posix" ] && IMGS=" " - [ -f "${DIR}/hard" ] && IMGS="${IMGS} " - [ -f "${DIR}/pending" ] && IMGS="${IMGS} " - GLOBAL_LIST_OF_TESTS="${GLOBAL_LIST_OF_TESTS}$(printf "% $(( INDEX * 2 ))s\052 [%s](%s)" "" "${DIR_NAME}${IMGS}" "${DIR}")\n" - run_create_readme "${INDEX}" "${DIR}" - else - - [ "${INDEX}" != "-1" ] && GLOBAL_LIST_OF_TESTS="${GLOBAL_LIST_OF_TESTS}$(printf "% $(( INDEX * 2 ))s\052 **[%s/](%s)**" "" "${DIR_NAME}" "${DIR}")\n" - - printf "# %s\n\n" "${DIR_NAME}" >"${README}" - [ "${INDEX}" != "-1" ] && printf "*[%s](%s) > %s*\n\n" "${PARENT_DIR_NAME//\// > }" ".." "${DIR_NAME}" >>"${README}" - - for SUBDIR in $(ls -1 "${DIR}") - do - if [ -d "${DIR}/${SUBDIR}" ] - then - printf "\052 [%s](%s)\n" "${SUBDIR}" "./${SUBDIR}" >>"${README}" - run_browse_directory "$(( INDEX + 1 ))" "${DIR}/${SUBDIR}" - fi - done - - fi -} - -run_browse_directory -1 "spec" - -awk -v SUPPORT_BINARIES_LIST="${GLOBAL_SUPPORT_BINARIES_LIST2}\n" -v LIST="${GLOBAL_LIST_OF_TESTS}" -v GLOBAL_TOTAL_TESTS="${GLOBAL_TOTAL_TESTS}" ' -BEGIN { - INSERT_DATA=0 -} -INSERT_DATA == 0 { - print -} -$0 ~ // { - INSERT_DATA=1; - print "42ShellTester is currently packaged with **"GLOBAL_TOTAL_TESTS" tests**." -} -$0 ~ // { - INSERT_DATA=0; - print -} -$0 ~ // { - INSERT_DATA=1; - print SUPPORT_BINARIES_LIST -} -$0 ~ // { - INSERT_DATA=0; - print -} -$0 ~ // { - INSERT_DATA=1; - print LIST -} -$0 ~ // { - INSERT_DATA=0; - print -} -' README.md > README.new.md && rm -f README.md && mv README.new.md README.md diff --git a/42sh/42sh_error b/42sh/42sh_error deleted file mode 100644 index 6455094c..00000000 --- a/42sh/42sh_error +++ /dev/null @@ -1,2501 +0,0 @@ -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/auteur b/42sh/auteur index 127f9bf3..b0e9923f 100644 --- a/42sh/auteur +++ b/42sh/auteur @@ -1,5 +1 @@ -alao -ariard -gwojda jhalford -wescande diff --git a/42sh/donovan_segaults_06-02 b/42sh/donovan_segaults_06-02 deleted file mode 100644 index f8217daf..00000000 --- a/42sh/donovan_segaults_06-02 +++ /dev/null @@ -1,533 +0,0 @@ -ls -cat -`ls` -` -`ls` -`ls` -`ls` -cat * -ls * -echo "*" -echo * -echo */* -ls -make -make -ls -ls | cat -ls | cat -e -`ls` -`ls` -`ls` -`ls` -`ls` -`ls` -`ls` -`ls` -ls -`ls` -echo `ls -l` -(ls) -`ls` -` -`ls` -` -` -` -` -` -` -(ls)) -(ls)) -(ls)) -` -( -`ls` -`ls` -`ls` -ls -` -ls -`ls` -` -) -(vim)) -ls -`ls` -`l` -ls -ls -ls -`ls` -ls -`ls` -ls m -ls m 2>/dev/null -ls -ls >/dev/null -ls m -ls m 2>&1 -ls m -ls m >/dev/null -ls m 2>/dev/null -ls m 2>&- -ls m -ls m 2>&- -ls -ls 1>/dev/null -ls merde -ls merde 2>/dev/null -ls merde 1>/dev/null -ls merde 3>/dev/null -ls merde 2>/dev/null -ls 2>/dev/null -ls -ls >/dev/null -ls >/dev/null -ls >/dev/null -ls >/dev/null -ls >/dev/null -ls >/dev/null -ls 1>/dev/null -ls 1>/dev/null -ls merde -ls merde >/dev/null -ls merde 2>/dev/null -ls merde 2>&- -ls merde 2<&- -ls merde 2<&- -ls merde 2<&- -ls -ls >&- -ls >&- -ls 2>&- -ls m 2>&- -ls -ls 1>&2 2>&- -ls 2>&- 1>&2 -ls 2>&- 1>&2 -ls 1>&2 2>&- -ls 1>&2 2>&- -ls 2>&- 1>&2 -ls 1>&2 -ls 1>&2 1>&- -ls 1>&- 1>&2 -ls 2>&- 1>&2 -ls 1>&- 2>&- -ls 1>&2- 2>&- -ls 1>&2 2>&- -ls 2>&- 1>&2 -ls 1>&2- -ls 1>&2 -ls 1>&2 1>&- -ls 1>&- 1>&2 -ls 1>&- 1>&2 -ls 2>&- -ls 2>&- 1>&- -ls 2>&- 1>&2 -ls 2>&- 1>&2 -ls 2>&- 1>&2 -ls 2>&- 1>&2 -ls 2>&- 1>&- -ls 2>&- 1>&- -ls 2>&- 1>&2 -ls 1>&2 2>&- - -ls -ls 2>&- -ls 2>&- 1>&2 -ls - -ls - -ls - -ls - ls -ls - ls - ls - - - ls -ls - -ls - - - - - - ls - -`ls` -` ` -`` `` -echo `ls``ls` -echo `ls` `ls` -`ls``ls` -a`ls` -`ls`` -`ls``ls` -`` -``` -```` -`` ``` -`` `` -```` -`` -`` -` -`` -ls -`` -` -make -`` -```` -`` `` -```` -`` `` -` -`` -```` -`` `` -```` -`` -`` -```` -```` -```` -```` -a`ls` echo `ls` -echo `ls` -echo `ls` -a`ls` -a`ls` -a`ls` -a`ls` -a`ls` -a`ls | wc` -ls - ls - ls -ls | cat - - -ls - -`` -` ` -```` -`` `` -cd -ls -alalalalal`ls` - - - 1 - ` - `` - ` ` -(vim)& `ls` -jobs -fg -fg -jobs -l -kill -9 80401 -jobs -jobs -fg -vim& -jobs -ls -vim& -ls& -jobs -fg -jobs -ls& -jobs -jobs -l -ls -ls& -jobs -vim -jobs -jobs -ls -ls& -jobs -ls& -jobs -vim& -fg -ls -a`la` -ls - -ls -ls - - -```` ```` `` -ls - -ls -ls >&- -ls >&waf- -ls >&24- -ls -{} -{()} -({}) -{(ls)} -() -ls -read -n 4 -read -n 5 -echo $REPLY -read -n 4 -l -read -n 4 -read - n5 -read -n 5 -echo $REPLY | cat -e -echo $REPLY -read -n 5 -echo $REPLY -read -n 3 -echo $REPLY -read -n 3 -echo $REPLY -read -n -s -read -n 2 -s -read -s -ls -read -n 3 -echo $REPLY -echo $REPLY | cat -e -echo $PATH -read -n 10 -echo $REPLY -read -n 10 -echo $REPLY -(ls) -(ls)l -(ls) -(ls)l -(ls) -(ls)l -{()} -{} -42sh_cpy > wc -l < Makefile -42sh_cpy > wc -l > Makefile -wc -l < Makefile -cat out1 -ls out -ls < out -ls > out -ls < out -ls>out -lsout -lsout -lsout -lsout -lsout -cat out -lsout -lsout -lsout -cat out -ls>out -lsout -rm out -ls >out -ls -l -ls out -ls -lsout -lsout -cat out -ls>out -make -ls>out -ls&- -ls -ls >&2 2>&- -ls > out -rm out -ls > out -ls -l -ls >out -; -l -ls -ls>out -cat out -wc -l out -ls -l >out -catout -cat out -cat out -lsout -lsout -wc -l file1 -cat file1 -cat file1 -cat file1 -cat out -wc -l &- 1>&2 -cat -cat /dev/random|base64|head -c 8 & -cat /dev/random|base64|head -c 8 -ls -stty -stty -a -ls -cat -ls 'abc -def' -ls 'abc -' -ls >&- -ls 2>&- -ls mm 2>&- -ls mm 2>&- -cd >&- -./a.out -ls -./a.out -./42sh -pwd -/Users/jhalford/minishell/a.out -ls | /Users/jhalford/minishell/a.out -/a | cat /dev/random | base64 > /dev/null -./42sh -sleep 66666 & -jobs -echo '\ - -' -ls \ - -ls '\' -ls "\" -\ - -\ -\ -\ -\ -\\ -\\ -abc\ -def -l\ -s -ls 3>&- -ls >&3 -ls -- -1>file3 -ls -- 9>file3 -ls -- 10>file3 -ls -- 9999999999999999999999999999999999999999999999999999999>file3 -ls -- 2147483648>file3 -ls -- 2147483647>file3 -ls -- >&2147483648 -ls -- >&2147483649 -ulimit -a -& -\\ \ \\\ -${$(})} ${$((}))} ${`}`} ${${a}} -( ls # ) -ls&&ls;ls||ls; -ls&&ls;ls||ls -echo a && echo b; -echo a || echo b; -echo a ||; echo b; -echo a; || echo b; -(ls;) ; -ls ;; ls -` ( echo "(ls" )` -` ( echo "(ls(" )` -` ( echo "(ls((" )` -`echo "ls -l"` -` echo "ls `echo .`"` diff --git a/42sh/minishell_error b/42sh/minishell_error deleted file mode 100644 index 883caec1..00000000 --- a/42sh/minishell_error +++ /dev/null @@ -1,332 +0,0 @@ -...x...~......xx....~.~.~......x....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 "TOKEN201703242314" - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703242314` - (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.UJksyURLXc/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p0:162D7F62-BEB1-405A-B3D5-E18A8A96E577 - 11: ZSH=/Users/ariard/.oh-my-zsh - 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.zEo8Maujhn/Listeners - 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,22653,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=w0t0p0:162D7F62-BEB1-405A-B3D5-E18A8A96E577 - 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.UJksyURLXc/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p0:162D7F62-BEB1-405A-B3D5-E18A8A96E577 - 11: ZSH=/Users/ariard/.oh-my-zsh - 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.zEo8Maujhn/Listeners - 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,22653,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=w0t0p0:162D7F62-BEB1-405A-B3D5-E18A8A96E577 - 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/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/42ShellTester/tmp/display_pwd - - STDOUT: - FAILURE expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42ShellTester/tmp:PWD` - 01: /Users/ariard - 02: PWD:/Users/ariard:PWD - - 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: - 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/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 TOKEN201703242314 - - STDOUT: - FAILURE expected_to match_regex `TOKEN201703242314` - (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` - -Total tests: 54 -Total failed tests: 6 -Total pending tests: 0 diff --git a/42sh/scriptheader.sh b/42sh/scriptheader.sh deleted file mode 100755 index aec703b0..00000000 --- a/42sh/scriptheader.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -verbose=0 -if [ "$1" = "-v" ] -then - verbose=1 -fi -word=$(git status -s | sed 's/.* //') -red="\033[38;5;1m" -gre="\033[38;5;2m" -cya="\033[38;5;6m" -res="\033[0m" - -elem_in_array () -{ - for cur in $2 - do - if [ "$1" = "$cur" ] - then - echo "1" - return 1 - fi - done - echo "0" - return 0 -} - -array_in_array () -{ - for cur in $1 - do - match=$(elem_in_array "$cur" "$2") - if [ "$match" -ne 1 ] - then - echo "0" - return 0 - fi - done - echo "1" - return 1 -} - -confirm () -{ - echo "$cya${1:-Are you sure? [y/N]}$res" - read -r -p " " response - case "$response" in - [yY][eE][sS]|[yY]) - true - ;; - *) - false - ;; - esac -} - -do_checkout () -{ - i_tmp=$(echo $i | sed 's/\//_/g') - cp $i "$HOME/Documents/.$i_tmp.back" - git checkout $i - if [ $verbose -eq 1 ] - then - echo "$gre D - O - N - E $res" - echo "$cya $i was checked out. A copy still exist in $HOME/Documents/.$i_tmp.back$res\n" - fi -} - -if [ $verbose -eq 1 ] -then - for i in $word - do - if [ -e $i ] - then - if [ -f $i ] - then - diff=$(git diff -U0 --exit-code --color $i) - if [ "$?" -eq 1 ] - then - nb_lines=$(echo "$diff" | wc -l) - if [ "$nb_lines" -eq 7 ] - then - match=$(array_in_array "-9 +9 Updated: by ### ########.fr" "$diff") - if [ $match -eq 1 ] - then - echo "\n$cya CHANGES on $i :$res" - echo "$diff" - confirm - if [ $? -eq 0 ] - then - do_checkout - else - echo "$cya Nothing done for $i$res\n" - fi - else - echo "$gre$i is not concerned (diff on the good lines)$res" - fi - else - echo "$gre$i is not concerned (diff is too big)$res" - fi - else - echo "$gre$i is not concerned (diff is null)$res" - fi - else - echo "$red$i is not a regular file$res" - fi - else - echo "$red$i doesn't exist$res" - fi - done -else - for i in $word - do - if [ -e $i ] - then - if [ -f $i ] - then - diff=$(git diff -U0 --exit-code --color $i) - if [ "$?" -eq 1 ] - then - nb_lines=$(echo "$diff" | wc -l) - if [ "$nb_lines" -eq 7 ] - then - match=$(array_in_array "-9 +9 Updated: by ### ########.fr" "$diff") - if [ $match -eq 1 ] - then - do_checkout - fi - fi - fi - fi - fi - done -fi diff --git a/42sh/update_makefile.sh b/42sh/update_makefile.sh deleted file mode 100755 index 0a4660f5..00000000 --- a/42sh/update_makefile.sh +++ /dev/null @@ -1,17 +0,0 @@ -MYPATH=$(pwd) -CUR_MAKEFILE=$MYPATH/Makefile -if [ -e $CUR_MAKEFILE ] -then - echo "regenerate Makefile" - sed "`grep -n 'SRC_BASE =' $CUR_MAKEFILE | sed 's/:.*//'`, \$d" $CUR_MAKEFILE > NEWMAKEFILE - grep 'SRC_BASE =' $CUR_MAKEFILE >> NEWMAKEFILE - expr "$(find ./src | grep "\.c$" | sed -e 's/src\///' -e 's/\.\///' -e 's/$/\\/')" : "\(.*\).$" >> NEWMAKEFILE - echo "" >> NEWMAKEFILE - grep 'SRCS =' $CUR_MAKEFILE >> NEWMAKEFILE - sed "1, `grep -n 'SRCS =' $CUR_MAKEFILE | sed 's/:.*//'`d" $CUR_MAKEFILE >> NEWMAKEFILE - mv $CUR_MAKEFILE ~/Documents/.OLDMakefile - mv NEWMAKEFILE $CUR_MAKEFILE - echo "Makefile done (copy still alive in ~/Documents/.OLDMakefile)" -else - echo "Makefile not found." -fi