From fc6833f577a6a93dbf3903baf69857ae59fe48b1 Mon Sep 17 00:00:00 2001 From: LuckyLaszlo Date: Wed, 8 Dec 2021 20:59:05 +0100 Subject: [PATCH] small adjust to tests --- unitests.sh | 4 +++- ut_builtins.sh | 34 ---------------------------------- ut_builtins_env.sh | 33 +++++++++++++++++++++++++++++++++ ut_exit_status.sh | 10 +++++----- ut_pipes.sh | 2 +- 5 files changed, 42 insertions(+), 41 deletions(-) create mode 100644 ut_builtins_env.sh diff --git a/unitests.sh b/unitests.sh index 2588016..dd0bbda 100644 --- a/unitests.sh +++ b/unitests.sh @@ -1,6 +1,8 @@ #!/bin/bash cd $(dirname $0) +MINISHELL="../minishell" + # COLORS RED="\e[0;31m" GREEN="\e[0;32m" @@ -21,7 +23,7 @@ cd $(dirname $0) ENDCO="\e[0m" # copy the executable to current directory - cp ../../minishell . + cp $MINISHELL . # globale variables UNIT_TEST=0 diff --git a/ut_builtins.sh b/ut_builtins.sh index e9827e6..2c008cc 100644 --- a/ut_builtins.sh +++ b/ut_builtins.sh @@ -1,9 +1,3 @@ -# -# ENV -# - -env - # # EXPORT # @@ -22,34 +16,6 @@ export "HI= hi" export "HI =hi" -export -env -# display is different for both commands - -env -export -env - -# -# UNSET -# - -export BLOU= -env -unset BLOU -env - -unset LOL ROR -env - -unset blablabla -env - -export "" -env -unset "" -env - # # ECHO # diff --git a/ut_builtins_env.sh b/ut_builtins_env.sh new file mode 100644 index 0000000..89de512 --- /dev/null +++ b/ut_builtins_env.sh @@ -0,0 +1,33 @@ +# +# ENV +# + +env + +export +env +# display is different for both commands + +env +export +env + +# +# UNSET +# + +export BLOU= +env +unset BLOU +env + +unset LOL ROR +env + +unset blablabla +env + +export "" +env +unset "" +env diff --git a/ut_exit_status.sh b/ut_exit_status.sh index 9a2968f..b0b0b1f 100644 --- a/ut_exit_status.sh +++ b/ut_exit_status.sh @@ -1,17 +1,17 @@ echo $? cat Makefile | grep pr | head -n 5 | cd test (mybin) -$? +echo $? cat Makefile | grep pr | head -n 5 | cat test (bin) -$? +echo $? cat Makefile | grep pr | head -n 5 | hello (NA) -$? +echo $? cat diufosgid -$? +echo $? exit -$? +echo $? diff --git a/ut_pipes.sh b/ut_pipes.sh index cd17612..b6c8855 100644 --- a/ut_pipes.sh +++ b/ut_pipes.sh @@ -32,7 +32,7 @@ rm output rm output -sleep 5 | exit +sleep 1 | exit ls | cat