diff --git a/42shTests.sh b/42shTests.sh index e6f3d74..f55b4f2 100644 --- a/42shTests.sh +++ b/42shTests.sh @@ -71,16 +71,6 @@ function run_verb_be_empty fi } -function run_verb_be_filled -{ - if [ "$(awk '{print}' "${RESPONSE}")" != "" ] - then - return 0 - else - return 1 - fi -} - function run_verb_have_nb_of_lines { if [ "$(awk 'END {printf NR}' "${RESPONSE}")" == "${EXPECTED_TO_ARGS[0]}" ] @@ -91,16 +81,6 @@ function run_verb_have_nb_of_lines fi } -function run_verb_have_not_regexp -{ - if [ "$(awk -v regexp="${EXPECTED_TO_ARGS[0]}" '$0 ~ regexp {print}' "${RESPONSE}")" == "" ] - then - return 0 - else - return 1 - fi -} - function run_verb_have_regexp { if [ "$(awk -v regexp="${EXPECTED_TO_ARGS[0]}" '$0 ~ regexp {print}' "${RESPONSE}")" != "" ] @@ -175,6 +155,24 @@ function run_expected_to esac } +function run_expected_to_not +{ + shift 1 + local EXPECTED_TO_CMD="${1}" + shift 1 + local -a EXPECTED_TO_ARGS='(${@})' + + eval "run_verb_${EXPECTED_TO_CMD}" + case "${?}" in + 1) + printf "${C_GREEN} √ ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + 0) + printf "${C_RED} ~ ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + 2) + printf "${C_RED} [!] INVALID TEST COMMAND: ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + esac +} + function run_might { shift 1 @@ -193,6 +191,24 @@ function run_might esac } +function run_might_not +{ + shift 1 + local EXPECTED_TO_CMD="${1}" + shift 1 + local -a EXPECTED_TO_ARGS=${@} + + eval "run_verb_${EXPECTED_TO_CMD}" + case "${?}" in + 1) + printf "${C_GREEN} √ ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + 0) + printf "${C_YELLOW} ~ ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + 2) + printf "${C_RED} [!] INVALID TEST COMMAND: ${EXPECTED_STD_NAME} %s${C_CLEAR}\n" "$(eval echo ${LINE})" ;; + esac +} + function run_expector { local LINE diff --git a/spec/21sh/redirections/outputs/closing/001-fd-not-specified/stdout b/spec/21sh/redirections/outputs/closing/001-fd-not-specified/stdout index 4f854b9..7bcbcdc 100644 --- a/spec/21sh/redirections/outputs/closing/001-fd-not-specified/stdout +++ b/spec/21sh/redirections/outputs/closing/001-fd-not-specified/stdout @@ -1 +1 @@ -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/closing/002-stdout-specified/stdout b/spec/21sh/redirections/outputs/closing/002-stdout-specified/stdout index 4f854b9..7bcbcdc 100644 --- a/spec/21sh/redirections/outputs/closing/002-stdout-specified/stdout +++ b/spec/21sh/redirections/outputs/closing/002-stdout-specified/stdout @@ -1 +1 @@ -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/closing/003-stderr-specified/stderr b/spec/21sh/redirections/outputs/closing/003-stderr-specified/stderr index 8b4c514..62472e2 100644 --- a/spec/21sh/redirections/outputs/closing/003-stderr-specified/stderr +++ b/spec/21sh/redirections/outputs/closing/003-stderr-specified/stderr @@ -1 +1 @@ -expected_to have_not_regexp "No such file or directory" +expected_to_not have_regexp "No such file or directory" diff --git a/spec/21sh/redirections/outputs/closing/004-twice/stderr b/spec/21sh/redirections/outputs/closing/004-twice/stderr index 8b4c514..62472e2 100644 --- a/spec/21sh/redirections/outputs/closing/004-twice/stderr +++ b/spec/21sh/redirections/outputs/closing/004-twice/stderr @@ -1 +1 @@ -expected_to have_not_regexp "No such file or directory" +expected_to_not have_regexp "No such file or directory" diff --git a/spec/21sh/redirections/outputs/closing/004-twice/stdout b/spec/21sh/redirections/outputs/closing/004-twice/stdout index 4f854b9..7bcbcdc 100644 --- a/spec/21sh/redirections/outputs/closing/004-twice/stdout +++ b/spec/21sh/redirections/outputs/closing/004-twice/stdout @@ -1 +1 @@ -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdout b/spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdout index f452a79..2f1e92f 100644 --- a/spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdout +++ b/spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdout @@ -1 +1 @@ -expected_to have_not_regexp TOKEN1 \ No newline at end of file +expected_to_not have_regexp TOKEN1 diff --git a/spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdout b/spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdout index 82adce4..dd5ace4 100644 --- a/spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdout +++ b/spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdout @@ -1 +1 @@ -expected_to have_not_regexp LAST_TOKEN \ No newline at end of file +expected_to_not have_regexp LAST_TOKEN diff --git a/spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdout b/spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdout index f452a79..2f1e92f 100644 --- a/spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdout +++ b/spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdout @@ -1 +1 @@ -expected_to have_not_regexp TOKEN1 \ No newline at end of file +expected_to_not have_regexp TOKEN1 diff --git a/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stderr b/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stderr index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stderr +++ b/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stderr @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdout b/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdout index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdout +++ b/spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stderr b/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stderr index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stderr +++ b/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stderr @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stdout b/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stdout index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stdout +++ b/spec/21sh/redirections/outputs/truncating/multiple/002-together-1/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stderr b/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stderr index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stderr +++ b/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stderr @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stdout b/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stdout index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stdout +++ b/spec/21sh/redirections/outputs/truncating/multiple/003-together-2/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stderr b/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stderr index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stderr +++ b/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stderr @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stdout b/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stdout index b047f9d..7d2ea79 100644 --- a/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stdout +++ b/spec/21sh/redirections/outputs/truncating/multiple/004-together-3/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" -expected_to have_not_regexp "42shTests.sh" +expected_to_not have_regexp "No such file or directory" +expected_to_not have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/stderr/001-works/stdout b/spec/21sh/redirections/outputs/truncating/stderr/001-works/stdout index d1b5481..0aa8a3f 100644 --- a/spec/21sh/redirections/outputs/truncating/stderr/001-works/stdout +++ b/spec/21sh/redirections/outputs/truncating/stderr/001-works/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "No such file or directory" +expected_to_not have_regexp "No such file or directory" expected_to have_regexp "42shTests.sh" diff --git a/spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdout b/spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdout index f452a79..2f1e92f 100644 --- a/spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdout +++ b/spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdout @@ -1 +1 @@ -expected_to have_not_regexp TOKEN1 \ No newline at end of file +expected_to_not have_regexp TOKEN1 diff --git a/spec/bonuses/separators/&&/002-do-not-run-second/stderr b/spec/bonuses/separators/&&/002-do-not-run-second/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/&&/002-do-not-run-second/stderr +++ b/spec/bonuses/separators/&&/002-do-not-run-second/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/&&/002-do-not-run-second/stdout b/spec/bonuses/separators/&&/002-do-not-run-second/stdout index 7b50666..c01098d 100644 --- a/spec/bonuses/separators/&&/002-do-not-run-second/stdout +++ b/spec/bonuses/separators/&&/002-do-not-run-second/stdout @@ -1,2 +1,2 @@ might be_empty -might have_not_regexp LAST_TOKEN +might_not have_regexp LAST_TOKEN diff --git a/spec/bonuses/separators/&&/003-parse-error-at-beginning/stderr b/spec/bonuses/separators/&&/003-parse-error-at-beginning/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/&&/003-parse-error-at-beginning/stderr +++ b/spec/bonuses/separators/&&/003-parse-error-at-beginning/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/&&/004-parse-error-at-end/stderr b/spec/bonuses/separators/&&/004-parse-error-at-end/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/&&/004-parse-error-at-end/stderr +++ b/spec/bonuses/separators/&&/004-parse-error-at-end/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/&&/005-parse-error-too-much-symbol/stderr b/spec/bonuses/separators/&&/005-parse-error-too-much-symbol/stderr index 7899225..92ac283 100644 --- a/spec/bonuses/separators/&&/005-parse-error-too-much-symbol/stderr +++ b/spec/bonuses/separators/&&/005-parse-error-too-much-symbol/stderr @@ -1,2 +1,2 @@ -might be_filled +might_not be_empty might have_nb_of_lines 2 diff --git a/spec/bonuses/separators/||/001-run-first-only/stdout b/spec/bonuses/separators/||/001-run-first-only/stdout index 64d9215..5e4faff 100644 --- a/spec/bonuses/separators/||/001-run-first-only/stdout +++ b/spec/bonuses/separators/||/001-run-first-only/stdout @@ -1,2 +1,2 @@ might have_regexp FIRST_TOKEN -might have_not_regexp LAST_TOKEN +might_not have_regexp LAST_TOKEN diff --git a/spec/bonuses/separators/||/002-run-second-only/stderr b/spec/bonuses/separators/||/002-run-second-only/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/||/002-run-second-only/stderr +++ b/spec/bonuses/separators/||/002-run-second-only/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/||/003-parse-error-at-beginning/stderr b/spec/bonuses/separators/||/003-parse-error-at-beginning/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/||/003-parse-error-at-beginning/stderr +++ b/spec/bonuses/separators/||/003-parse-error-at-beginning/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/||/004-parse-error-at-end/stderr b/spec/bonuses/separators/||/004-parse-error-at-end/stderr index e2daba8..decbd4d 100644 --- a/spec/bonuses/separators/||/004-parse-error-at-end/stderr +++ b/spec/bonuses/separators/||/004-parse-error-at-end/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/bonuses/separators/||/005-parse-error-too-much-symbol/stderr b/spec/bonuses/separators/||/005-parse-error-too-much-symbol/stderr index 7899225..92ac283 100644 --- a/spec/bonuses/separators/||/005-parse-error-too-much-symbol/stderr +++ b/spec/bonuses/separators/||/005-parse-error-too-much-symbol/stderr @@ -1,2 +1,2 @@ -might be_filled +might_not be_empty might have_nb_of_lines 2 diff --git a/spec/minishell/001-builtins/cd/001-no-arg/before_exec b/spec/minishell/001-builtins/cd/001-no-arg/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/001-no-arg/before_exec +++ b/spec/minishell/001-builtins/cd/001-no-arg/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/001-no-arg/stdout b/spec/minishell/001-builtins/cd/001-no-arg/stdout index 286885d..8f66e8c 100644 --- a/spec/minishell/001-builtins/cd/001-no-arg/stdout +++ b/spec/minishell/001-builtins/cd/001-no-arg/stdout @@ -1,2 +1,2 @@ -expected_to have_not_regexp "${GLOBAL_TMP_DIRECTORY}$" -expected_to have_regexp "PWD:${HOME}:PWD$" \ No newline at end of file +expected_to_not have_regexp "${GLOBAL_TMP_DIRECTORY}$" +expected_to have_regexp "PWD:${HOME}:PWD$" diff --git a/spec/minishell/001-builtins/cd/002-current-directory/before_exec b/spec/minishell/001-builtins/cd/002-current-directory/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/002-current-directory/before_exec +++ b/spec/minishell/001-builtins/cd/002-current-directory/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/003-current-directory-2/before_exec b/spec/minishell/001-builtins/cd/003-current-directory-2/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/003-current-directory-2/before_exec +++ b/spec/minishell/001-builtins/cd/003-current-directory-2/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/004-parent-directory/before_exec b/spec/minishell/001-builtins/cd/004-parent-directory/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/004-parent-directory/before_exec +++ b/spec/minishell/001-builtins/cd/004-parent-directory/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/005-absolute-path/before_exec b/spec/minishell/001-builtins/cd/005-absolute-path/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/005-absolute-path/before_exec +++ b/spec/minishell/001-builtins/cd/005-absolute-path/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/007-symbolic-link/before_exec b/spec/minishell/001-builtins/cd/007-symbolic-link/before_exec index 1be40dc..4429f5b 100644 --- a/spec/minishell/001-builtins/cd/007-symbolic-link/before_exec +++ b/spec/minishell/001-builtins/cd/007-symbolic-link/before_exec @@ -3,4 +3,4 @@ rm -f symbolic_link ln -s .. symbolic_link rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/008-symbolic-link-2/before_exec b/spec/minishell/001-builtins/cd/008-symbolic-link-2/before_exec index 79250d5..f52c151 100644 --- a/spec/minishell/001-builtins/cd/008-symbolic-link-2/before_exec +++ b/spec/minishell/001-builtins/cd/008-symbolic-link-2/before_exec @@ -3,4 +3,4 @@ ln -s .. symbolic_link1 ln -s symbolic_link1 symbolic_link2 rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/009-following-links/before_exec b/spec/minishell/001-builtins/cd/009-following-links/before_exec index 337bf07..3a872b1 100644 --- a/spec/minishell/001-builtins/cd/009-following-links/before_exec +++ b/spec/minishell/001-builtins/cd/009-following-links/before_exec @@ -4,4 +4,4 @@ ln -s subdirectory subdirectory_link ln -s subsubdirectory subdirectory/subsubdirectory_link rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/errors/001-not-a-directory/before_exec b/spec/minishell/001-builtins/cd/errors/001-not-a-directory/before_exec index d491f5a..95f22b8 100644 --- a/spec/minishell/001-builtins/cd/errors/001-not-a-directory/before_exec +++ b/spec/minishell/001-builtins/cd/errors/001-not-a-directory/before_exec @@ -1,4 +1,4 @@ touch not_a_directory rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/errors/001-not-a-directory/stderr b/spec/minishell/001-builtins/cd/errors/001-not-a-directory/stderr index 57d085c..2656541 100644 --- a/spec/minishell/001-builtins/cd/errors/001-not-a-directory/stderr +++ b/spec/minishell/001-builtins/cd/errors/001-not-a-directory/stderr @@ -1,2 +1,2 @@ -expected_to be_filled -might have_regexp "[Nn]ot a directory" \ No newline at end of file +expected_to_not be_empty +might have_regexp "[Nn]ot a directory" diff --git a/spec/minishell/001-builtins/cd/errors/002-permission-denied/before_exec b/spec/minishell/001-builtins/cd/errors/002-permission-denied/before_exec index 901c52c..6f5990f 100644 --- a/spec/minishell/001-builtins/cd/errors/002-permission-denied/before_exec +++ b/spec/minishell/001-builtins/cd/errors/002-permission-denied/before_exec @@ -2,4 +2,4 @@ if [ -d permission_denied ]; then chmod 777 permission_denied; rm -r permission_ mkdir -m 0 permission_denied rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/errors/002-permission-denied/stderr b/spec/minishell/001-builtins/cd/errors/002-permission-denied/stderr index 8539a6e..b99f8f2 100644 --- a/spec/minishell/001-builtins/cd/errors/002-permission-denied/stderr +++ b/spec/minishell/001-builtins/cd/errors/002-permission-denied/stderr @@ -1,2 +1,2 @@ -expected_to be_filled -might have_regexp "[Pp]ermission denied" \ No newline at end of file +expected_to_not be_empty +might have_regexp "[Pp]ermission denied" diff --git a/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/before_exec b/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/before_exec index 62e8528..53f6c15 100644 --- a/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/before_exec +++ b/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/before_exec @@ -4,4 +4,4 @@ ln -s symbolic_link2 symbolic_link3 ln -s symbolic_link3 symbolic_link1 rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/stderr b/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/stderr index cabcdfc..5d25fda 100644 --- a/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/stderr +++ b/spec/minishell/001-builtins/cd/errors/003-too-many-symbolic-links-encountered/stderr @@ -1,2 +1,2 @@ -expected_to be_filled -might have_regexp "[Tt]oo many symbolic links encountered" \ No newline at end of file +expected_to_not be_empty +might have_regexp "[Tt]oo many symbolic links encountered" diff --git a/spec/minishell/001-builtins/cd/errors/004-no-such-file-or-directory/stderr b/spec/minishell/001-builtins/cd/errors/004-no-such-file-or-directory/stderr index 0a8dbf1..3f43d4c 100644 --- a/spec/minishell/001-builtins/cd/errors/004-no-such-file-or-directory/stderr +++ b/spec/minishell/001-builtins/cd/errors/004-no-such-file-or-directory/stderr @@ -1,2 +1,2 @@ -expected_to be_filled -might have_regexp "[Nn]o such file or directory" \ No newline at end of file +expected_to_not be_empty +might have_regexp "[Nn]o such file or directory" diff --git a/spec/minishell/001-builtins/cd/options/001-not-following-links/before_exec b/spec/minishell/001-builtins/cd/options/001-not-following-links/before_exec index 337bf07..3a872b1 100644 --- a/spec/minishell/001-builtins/cd/options/001-not-following-links/before_exec +++ b/spec/minishell/001-builtins/cd/options/001-not-following-links/before_exec @@ -4,4 +4,4 @@ ln -s subdirectory subdirectory_link ln -s subsubdirectory subdirectory/subsubdirectory_link rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/cd/options/001-not-following-links/stdout b/spec/minishell/001-builtins/cd/options/001-not-following-links/stdout index 1592406..d5dc796 100644 --- a/spec/minishell/001-builtins/cd/options/001-not-following-links/stdout +++ b/spec/minishell/001-builtins/cd/options/001-not-following-links/stdout @@ -1,5 +1,5 @@ -might have_not_regexp "${GLOBAL_TMP_DIRECTORY}/subdirectory_link$" +might_not have_regexp "${GLOBAL_TMP_DIRECTORY}/subdirectory_link$" might have_regexp "PWD:${GLOBAL_TMP_DIRECTORY}/subdirectory:PWD$" -might have_not_regexp "${GLOBAL_TMP_DIRECTORY}/subdirectory_link/subsubdirectory_link$" +might_not have_regexp "${GLOBAL_TMP_DIRECTORY}/subdirectory_link/subsubdirectory_link$" might have_regexp "PWD:${GLOBAL_TMP_DIRECTORY}/subdirectory/subsubdirectory:PWD$" diff --git a/spec/minishell/001-builtins/cd/options/002-oldpwd/before_exec b/spec/minishell/001-builtins/cd/options/002-oldpwd/before_exec index 51b4abc..d446a73 100644 --- a/spec/minishell/001-builtins/cd/options/002-oldpwd/before_exec +++ b/spec/minishell/001-builtins/cd/options/002-oldpwd/before_exec @@ -1,2 +1,2 @@ rm -f display_pwd -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-pwd/main.c -o display_pwd \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-pwd/main.c -o display_pwd diff --git a/spec/minishell/001-builtins/env/003-ignore-environment-1/before_exec b/spec/minishell/001-builtins/env/003-ignore-environment-1/before_exec index c26f634..b411188 100644 --- a/spec/minishell/001-builtins/env/003-ignore-environment-1/before_exec +++ b/spec/minishell/001-builtins/env/003-ignore-environment-1/before_exec @@ -1,2 +1,2 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env diff --git a/spec/minishell/001-builtins/env/004-ignore-environment-2/before_exec b/spec/minishell/001-builtins/env/004-ignore-environment-2/before_exec index c26f634..b411188 100644 --- a/spec/minishell/001-builtins/env/004-ignore-environment-2/before_exec +++ b/spec/minishell/001-builtins/env/004-ignore-environment-2/before_exec @@ -1,2 +1,2 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env diff --git a/spec/minishell/001-builtins/env/005-set-variables/before_exec b/spec/minishell/001-builtins/env/005-set-variables/before_exec index c26f634..b411188 100644 --- a/spec/minishell/001-builtins/env/005-set-variables/before_exec +++ b/spec/minishell/001-builtins/env/005-set-variables/before_exec @@ -1,2 +1,2 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env diff --git a/spec/minishell/001-builtins/env/006-unset-variables-1/before_exec b/spec/minishell/001-builtins/env/006-unset-variables-1/before_exec index 346dccb..b989327 100644 --- a/spec/minishell/001-builtins/env/006-unset-variables-1/before_exec +++ b/spec/minishell/001-builtins/env/006-unset-variables-1/before_exec @@ -1,3 +1,3 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env -export TESTVARIABLE=TOKEN \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env +export TESTVARIABLE=TOKEN diff --git a/spec/minishell/001-builtins/env/006-unset-variables-1/stdout b/spec/minishell/001-builtins/env/006-unset-variables-1/stdout index 3d432d3..bae7ef7 100644 --- a/spec/minishell/001-builtins/env/006-unset-variables-1/stdout +++ b/spec/minishell/001-builtins/env/006-unset-variables-1/stdout @@ -1,3 +1,3 @@ -might have_not_regexp "HOME=" -might have_not_regexp "PATH=" -might have_not_regexp "TESTVARIABLE=" \ No newline at end of file +might_not have_regexp "HOME=" +might_not have_regexp "PATH=" +might_not have_regexp "TESTVARIABLE=" diff --git a/spec/minishell/001-builtins/env/007-unset-variables-2/before_exec b/spec/minishell/001-builtins/env/007-unset-variables-2/before_exec index 346dccb..b989327 100644 --- a/spec/minishell/001-builtins/env/007-unset-variables-2/before_exec +++ b/spec/minishell/001-builtins/env/007-unset-variables-2/before_exec @@ -1,3 +1,3 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env -export TESTVARIABLE=TOKEN \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env +export TESTVARIABLE=TOKEN diff --git a/spec/minishell/001-builtins/env/007-unset-variables-2/stdout b/spec/minishell/001-builtins/env/007-unset-variables-2/stdout index 3d432d3..bae7ef7 100644 --- a/spec/minishell/001-builtins/env/007-unset-variables-2/stdout +++ b/spec/minishell/001-builtins/env/007-unset-variables-2/stdout @@ -1,3 +1,3 @@ -might have_not_regexp "HOME=" -might have_not_regexp "PATH=" -might have_not_regexp "TESTVARIABLE=" \ No newline at end of file +might_not have_regexp "HOME=" +might_not have_regexp "PATH=" +might_not have_regexp "TESTVARIABLE=" diff --git a/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stderr b/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stderr index a3ba015..015e6d0 100644 --- a/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stderr +++ b/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stderr @@ -1 +1 @@ -expected_to be_filled \ No newline at end of file +expected_to_not be_empty diff --git a/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stdout b/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stdout index 1617e2b..9f00663 100644 --- a/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stdout +++ b/spec/minishell/001-builtins/env/calling-builtins/001-cd-HOME-without-environment/stdout @@ -1,2 +1,2 @@ expected_to have_regexp "${GLOBAL_TMP_DIRECTORY}$" -expected_to have_not_regexp "${HOME}$" \ No newline at end of file +expected_to_not have_regexp "${HOME}$" diff --git a/spec/minishell/001-builtins/env/multiple-options/001-ignore-environment-and-set-variable/before_exec b/spec/minishell/001-builtins/env/multiple-options/001-ignore-environment-and-set-variable/before_exec index c26f634..b411188 100644 --- a/spec/minishell/001-builtins/env/multiple-options/001-ignore-environment-and-set-variable/before_exec +++ b/spec/minishell/001-builtins/env/multiple-options/001-ignore-environment-and-set-variable/before_exec @@ -1,2 +1,2 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env diff --git a/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/before_exec b/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/before_exec index c26f634..b411188 100644 --- a/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/before_exec +++ b/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/before_exec @@ -1,2 +1,2 @@ rm -f display_env -gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/spec/support/display-env/main.c -o display_env \ No newline at end of file +gcc -Wall -Werror -Wextra ${GLOBAL_INSTALLDIR}/support/display-env/main.c -o display_env diff --git a/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/stdout b/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/stdout index 98f59c9..7402abc 100644 --- a/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/stdout +++ b/spec/minishell/001-builtins/env/multiple-options/002-unset-and-set-variable/stdout @@ -1,5 +1,5 @@ might have_regexp "START DISPLAYING ENVIRONMENT VARIABLES$" might have_regexp "TESTVARIABLE=TOKEN$" -might have_not_regexp "HOME=" -might have_not_regexp "PATH=" -might have_regexp "END DISPLAYING ENVIRONMENT VARIABLES$" \ No newline at end of file +might_not have_regexp "HOME=" +might_not have_regexp "PATH=" +might have_regexp "END DISPLAYING ENVIRONMENT VARIABLES$" diff --git a/spec/minishell/001-builtins/exit/001-simple/stdout b/spec/minishell/001-builtins/exit/001-simple/stdout index 4d605cf..3ef12c5 100644 --- a/spec/minishell/001-builtins/exit/001-simple/stdout +++ b/spec/minishell/001-builtins/exit/001-simple/stdout @@ -1 +1 @@ -expected_to have_not_regexp INVISIBLE_TOKEN \ No newline at end of file +expected_to_not have_regexp INVISIBLE_TOKEN diff --git a/spec/minishell/001-builtins/exit/003-too-many-args/stderr b/spec/minishell/001-builtins/exit/003-too-many-args/stderr index da37e21..decbd4d 100644 --- a/spec/minishell/001-builtins/exit/003-too-many-args/stderr +++ b/spec/minishell/001-builtins/exit/003-too-many-args/stderr @@ -1 +1 @@ -might be_filled \ No newline at end of file +might_not be_empty diff --git a/spec/minishell/001-builtins/setenv/002-setenv-noequal/stderr b/spec/minishell/001-builtins/setenv/002-setenv-noequal/stderr index e2daba8..decbd4d 100644 --- a/spec/minishell/001-builtins/setenv/002-setenv-noequal/stderr +++ b/spec/minishell/001-builtins/setenv/002-setenv-noequal/stderr @@ -1 +1 @@ -might be_filled +might_not be_empty diff --git a/spec/minishell/001-builtins/setenv/003-setenv-equal/stderr b/spec/minishell/001-builtins/setenv/003-setenv-equal/stderr index da37e21..decbd4d 100644 --- a/spec/minishell/001-builtins/setenv/003-setenv-equal/stderr +++ b/spec/minishell/001-builtins/setenv/003-setenv-equal/stderr @@ -1 +1 @@ -might be_filled \ No newline at end of file +might_not be_empty diff --git a/spec/minishell/001-builtins/unsetenv/001-unsetenv-first-elem/stdout b/spec/minishell/001-builtins/unsetenv/001-unsetenv-first-elem/stdout index 93e7ad8..2936e21 100644 --- a/spec/minishell/001-builtins/unsetenv/001-unsetenv-first-elem/stdout +++ b/spec/minishell/001-builtins/unsetenv/001-unsetenv-first-elem/stdout @@ -1 +1 @@ -expected_to have_not_regexp $SSH_AUTH_SOCK +expected_to_not have_regexp $SSH_AUTH_SOCK diff --git a/spec/minishell/001-builtins/unsetenv/002-unsetenv-last-elem/stdout b/spec/minishell/001-builtins/unsetenv/002-unsetenv-last-elem/stdout index 236b24e..58071e2 100644 --- a/spec/minishell/001-builtins/unsetenv/002-unsetenv-last-elem/stdout +++ b/spec/minishell/001-builtins/unsetenv/002-unsetenv-last-elem/stdout @@ -1 +1 @@ -expected_to have_not_regexp $LSCOLORS \ No newline at end of file +expected_to_not have_regexp $LSCOLORS diff --git a/spec/minishell/001-builtins/unsetenv/003-unsetenv-mult-argv/stdout b/spec/minishell/001-builtins/unsetenv/003-unsetenv-mult-argv/stdout index fc4d434..8106c73 100644 --- a/spec/minishell/001-builtins/unsetenv/003-unsetenv-mult-argv/stdout +++ b/spec/minishell/001-builtins/unsetenv/003-unsetenv-mult-argv/stdout @@ -1,18 +1,18 @@ -expected_to have_not_regexp $SSH_AUTH_SOCK -expected_to have_not_regexp $Apple_PubSub_Socket_Render -expected_to have_not_regexp $COLORFGBG -expected_to have_not_regexp $ITERM_PROFILE -expected_to have_not_regexp $XPC_FLAGS -expected_to have_not_regexp $LANG -expected_to have_not_regexp $SHELL -expected_to have_not_regexp $TERM_PROGRAM -expected_to have_not_regexp $TERM -expected_to have_not_regexp $TMPDIR -expected_to have_not_regexp $__CF_USER_TEXT_ENCODING -expected_to have_not_regexp $ITERM_SESSION_ID -expected_to have_not_regexp $PAGER -expected_to have_not_regexp $ZSH -expected_to have_not_regexp $LESS -expected_to have_not_regexp $LC_CTYPE -expected_to have_not_regexp $LSCOLORS -expected_to have_not_regexp $PATH +expected_to_not have_regexp $SSH_AUTH_SOCK +expected_to_not have_regexp $Apple_PubSub_Socket_Render +expected_to_not have_regexp $COLORFGBG +expected_to_not have_regexp $ITERM_PROFILE +expected_to_not have_regexp $XPC_FLAGS +expected_to_not have_regexp $LANG +expected_to_not have_regexp $SHELL +expected_to_not have_regexp $TERM_PROGRAM +expected_to_not have_regexp $TERM +expected_to_not have_regexp $TMPDIR +expected_to_not have_regexp $__CF_USER_TEXT_ENCODING +expected_to_not have_regexp $ITERM_SESSION_ID +expected_to_not have_regexp $PAGER +expected_to_not have_regexp $ZSH +expected_to_not have_regexp $LESS +expected_to_not have_regexp $LC_CTYPE +expected_to_not have_regexp $LSCOLORS +expected_to_not have_regexp $PATH diff --git a/spec/minishell/001-builtins/unsetenv/004-unsetenv-mult-argv-inline/stdout b/spec/minishell/001-builtins/unsetenv/004-unsetenv-mult-argv-inline/stdout index fc4d434..8106c73 100644 --- a/spec/minishell/001-builtins/unsetenv/004-unsetenv-mult-argv-inline/stdout +++ b/spec/minishell/001-builtins/unsetenv/004-unsetenv-mult-argv-inline/stdout @@ -1,18 +1,18 @@ -expected_to have_not_regexp $SSH_AUTH_SOCK -expected_to have_not_regexp $Apple_PubSub_Socket_Render -expected_to have_not_regexp $COLORFGBG -expected_to have_not_regexp $ITERM_PROFILE -expected_to have_not_regexp $XPC_FLAGS -expected_to have_not_regexp $LANG -expected_to have_not_regexp $SHELL -expected_to have_not_regexp $TERM_PROGRAM -expected_to have_not_regexp $TERM -expected_to have_not_regexp $TMPDIR -expected_to have_not_regexp $__CF_USER_TEXT_ENCODING -expected_to have_not_regexp $ITERM_SESSION_ID -expected_to have_not_regexp $PAGER -expected_to have_not_regexp $ZSH -expected_to have_not_regexp $LESS -expected_to have_not_regexp $LC_CTYPE -expected_to have_not_regexp $LSCOLORS -expected_to have_not_regexp $PATH +expected_to_not have_regexp $SSH_AUTH_SOCK +expected_to_not have_regexp $Apple_PubSub_Socket_Render +expected_to_not have_regexp $COLORFGBG +expected_to_not have_regexp $ITERM_PROFILE +expected_to_not have_regexp $XPC_FLAGS +expected_to_not have_regexp $LANG +expected_to_not have_regexp $SHELL +expected_to_not have_regexp $TERM_PROGRAM +expected_to_not have_regexp $TERM +expected_to_not have_regexp $TMPDIR +expected_to_not have_regexp $__CF_USER_TEXT_ENCODING +expected_to_not have_regexp $ITERM_SESSION_ID +expected_to_not have_regexp $PAGER +expected_to_not have_regexp $ZSH +expected_to_not have_regexp $LESS +expected_to_not have_regexp $LC_CTYPE +expected_to_not have_regexp $LSCOLORS +expected_to_not have_regexp $PATH diff --git a/spec/support/display-env/main.c b/support/display-env/main.c similarity index 100% rename from spec/support/display-env/main.c rename to support/display-env/main.c diff --git a/spec/support/display-pwd/main.c b/support/display-pwd/main.c similarity index 100% rename from spec/support/display-pwd/main.c rename to support/display-pwd/main.c