From a183971a7a3331afa4237babd21da7d61cabfa17 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Fri, 17 Feb 2023 18:23:17 +0100 Subject: [PATCH] bozo --- .main.c.swp | Bin 0 -> 12288 bytes cmd.c | 2 +- env_fill.c | 5 +- main.c | 14 +---- minishell.h | 5 +- t | 1 - test.sh | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 164 insertions(+), 18 deletions(-) create mode 100644 .main.c.swp delete mode 100644 t create mode 100644 test.sh diff --git a/.main.c.swp b/.main.c.swp new file mode 100644 index 0000000000000000000000000000000000000000..037d59477269c1d914b91aa7e586626413bc9dad GIT binary patch literal 12288 zcmeI2Ux?g99LJ|>PothntAa)B+-|koz3uKLz1CxErJSu&sKpk~f?7i^nY|0mX4h=? z+U=oLx#~;xLEl8`n@~YTDHKuPw8clIh>Btb^+76%FM=ZY{Uw=f?r!Z}+e0Z#%I7AT zOuqB`edkZOYsQBj+3_GBDeDZ!O^ls8`Kx{Q$Wd+6M}y3^C$09B2Vr(gtm4ulmp6v%g_PKVeAxs*u2JeG6!Ex|Br~?yh1|wh%xD~7fziEtp1HJ;EfRo?^cm+HIo&x*9 zUa$k)5BkBM*D&@6_z|1|C%_xvWiSJt1&@NgU^^HFH-kR#`_+v70KNxjz~|sIa2lKf z$G~ggCGa9R4EBLhFbFhowvVxI!3W?tcmd1+8|(o(sDLskfVJQ*a3}bCIb(l;U%*-L z9rzf$1zrb-zyxr>C>R1cuo`Hf5B!8V@FjQ;90RX{1Hb`eU^mzW)`Q!@DsUU1xzo9l zv3pTEC=HZ4P)F=QJ}-R7tzqIZtriGTaIDbkRaX}N)Vj@R6q;VESA+knZdPES?FlQ0 zlA!t$#}CsH9z~7}BeXz-?ZD>+oocmi+ENKsl;ruev}ru))_B2leZjYE;k(9m?p%ku z_?kmtLWE|!B?8m+o9!?SDe5zFnwrK}p_zVhl(s8zc^_RJm~=gnbT*K7MhVT%B^|*u zl?5|_dXGF7m&UBlNrfg4b)9jfTgCBJRcPXF0U&Xv;Tx_%D^gz=h|r{_8vWSJrkU%9 z8hw3LzzMhP5~s$zShO&x$tlUuEY1tBC88ND0~&%n{nZ$o55tDdEkM)B7%rzN% z$b8xPx(iRC#CQbIYw)e9$Mk*c$VZ)~l}wDLY|jWT*!@LnT6Pk{#Sc&(v2EKvI`+W4 zA&Qn`Hnn6i(u^=^CHwLEpnb`%JFWOCvo@)+M2ih4$tu@uuh9~iH8m`m=z+MRfsc%m zny&NoyeSR}yB#)ysEcUFNPV9>`2T5q6kKK@#g~+9(+XPf2e+f`Cw3|dyo5DIS(bPv z-NhyGZ!X1x6vui4Gf`er9PxQ32C{omy(J@%1euDb*QB0YT!K7AS{*;MLf1B@MBvu4 zT60%bx(mj3W{mI7M!tmt^BY0k^4vori1d&&*%E465;07OE@OLe)!pV|ZB$_nyRA?w z7HJe|yK6;ZV)#PZIl4PS+z|U7HaofTQ9#)E;Iv#jQ4M6H{l6JB>dlbG!g3sQ68$uS zjto`4paNkz^i-kSIy-XF>kJAMjA#Z3t5(RRQB^q%@ESI+S(t3j<9?2Mn~vWkv0%nO zSwY^l!k{jK30P;8IK3gKEUzuh@s7D)bPBnL_HN6?E3m|KYdFbD`(hPz({(fBTU?0_ z=Dc;Y_QA5e>)T%25xkpAc`}!&_T2GWc(4)|bcX|a^Ld=(XLR7Z=;V$Rybm*Ew%{hNZ>;K@s`_wG zL7pEZMOh?r{Nhp`gjn(qLO4t1x`LyfYB#NWWP)2;AqLnFGhcnj&qgAHRjHKGlqqNW zSllV8brlh3qAmsFug4dsm9(l3R^zkeBrc@j1xd-q)vA=l86CKBNrF;1TgHM*wN8py HbQSgwQIoBZ literal 0 HcmV?d00001 diff --git a/cmd.c b/cmd.c index cfe007d..db908e3 100644 --- a/cmd.c +++ b/cmd.c @@ -6,7 +6,7 @@ /* By: cchauvet # include # include -# define DEBUG 0 +# define DEBUG 1 + int ft_syntatic_verif(const char *str); int ft_file_is_readable(const char *path); int ft_file_is_writable(const char *path); diff --git a/t b/t deleted file mode 100644 index 363df41..0000000 --- a/t +++ /dev/null @@ -1 +0,0 @@ -bozt diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..f2b1fe5 --- /dev/null +++ b/test.sh @@ -0,0 +1,155 @@ +# MINISHELL-TESTER + +RESET="\033[0m" +BLACK="\033[30m" +RED="\033[31m" +GREEN="\033[32m" +YELLOW="\033[33m" +BLUE="\033[34m" +MAGENTA="\033[35m" +CYAN="\033[36m" +WHITE="\033[37m" + +BOLDBLACK="\033[1m\033[30m" +BOLDRED="\033[1m\033[31m" +BOLDGREEN="\033[1m\033[32m" +BOLDYELLOW="\033[1m\033[33m" +BOLDBLUE="\033[1m\033[34m" +BOLDMAGENTA="\033[1m\033[35m" +BOLDCYAN="\033[1m\033[36m" +BOLDWHITE="\033[1m\033[37m" + +# Compile and set executable rights +make -C ../ > /dev/null +cp ../minishell . +chmod 755 minishell + +function exec_test() +{ + TEST1=$(echo $@ "; exit" | ./minishell 2>&-) + ES_1=$? + TEST2=$(echo $@ "; exit" | bash 2>&-) + ES_2=$? + if [ "$TEST1" == "$TEST2" ] && [ "$ES_1" == "$ES_2" ]; then + printf " $BOLDGREEN%s$RESET" "✓ " + else + printf " $BOLDRED%s$RESET" "✗ " + fi + printf "$CYAN \"$@\" $RESET" + if [ "$TEST1" != "$TEST2" ]; then + echo + echo + printf $BOLDRED"Your output : \n%.20s\n$BOLDRED$TEST1\n%.20s$RESET\n" "-----------------------------------------" "-----------------------------------------" + printf $BOLDGREEN"Expected output : \n%.20s\n$BOLDGREEN$TEST2\n%.20s$RESET\n" "-----------------------------------------" "-----------------------------------------" + fi + if [ "$ES_1" != "$ES_2" ]; then + echo + echo + printf $BOLDRED"Your exit status : $BOLDRED$ES_1$RESET\n" + printf $BOLDGREEN"Expected exit status : $BOLDGREEN$ES_2$RESET\n" + fi + echo + sleep 0.1 +} + +printf "$BOLDMAGENTA __ __ _____ _ _ _____ _____ _ _ ______ _ _ \n" +printf "| \/ |_ _| \ | |_ _|/ ____| | | | ____| | | | \n" +printf "| \ / | | | | \| | | | | (___ | |__| | |__ | | | | \n" +printf "| |\/| | | | | . \` | | | \___ \| __ | __| | | | | \n" +printf "| | | |_| |_| |\ |_| |_ ____) | | | | |____| |____| |____ \n" +printf "|_| |_|_____|_| \_|_____|_____/|_| |_|______|______|______|\n$RESET" +echo + +# ECHO TESTS +exec_test 'echo test tout' +exec_test 'echo test tout' +exec_test 'echo -n test tout' +exec_test 'echo -n -n -n test tout' + + +# CD TESTS +exec_test 'cd .. ; pwd' +exec_test 'cd /Users ; pwd' +exec_test 'cd ; pwd' +exec_test 'mkdir test_dir ; cd test_dir ; rm -rf ../test_dir ; cd . ; pwd ; cd . ; pwd ; cd .. ; pwd' + + +# PIPE TESTS +exec_test 'cat tests/lorem.txt | grep arcu | cat -e' +exec_test 'echo test | cat -e | cat -e | cat -e | cat -e | cat -e | cat -e | cat -e | cat -e | cat -e | cat -e| cat -e| cat -e| cat -e| cat -e| cat -e| cat -e| cat -e| cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e|cat -e' +exec_test 'cat /dev/random | head -c 100 | wc -c' +exec_test 'ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|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ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls|ls' + +# ENV EXPANSIONS + ESCAPE +exec_test 'echo test \ test' +exec_test 'echo \"test' +exec_test 'echo $TEST' +exec_test 'echo "$TEST"' +exec_test "echo '$TEST'" +exec_test 'echo "$TEST$TEST$TEST"' +exec_test 'echo "$TEST$TEST=lol$TEST"' +exec_test 'echo " $TEST lol $TEST"' +exec_test 'echo $TEST$TEST$TEST' +exec_test 'echo $TEST$TEST=lol$TEST""lol' +exec_test 'echo $TEST lol $TEST' +exec_test 'echo test "" test "" test' +exec_test 'echo "\$TEST"' +exec_test 'echo "$=TEST"' +exec_test 'echo "$"' +exec_test 'echo "$?TEST"' +exec_test 'echo $TEST $TEST' +exec_test 'echo "$1TEST"' +exec_test 'echo "$T1TEST"' + +# ENV EXPANSIONS +ENV_SHOW="env | sort | grep -v SHLVL | grep -v _=" +EXPORT_SHOW="export | sort | grep -v SHLVL | grep -v _= | grep -v OLDPWD" +exec_test 'export =' +exec_test 'export 1TEST= ;' $ENV_SHOW +exec_test 'export TEST ;' $EXPORT_SHOW +exec_test 'export ""="" ; ' $ENV_SHOW +exec_test 'export TES=T="" ;' $ENV_SHOW +exec_test 'export TE+S=T="" ;' $ENV_SHOW +exec_test 'export TEST=LOL ; echo $TEST ;' $ENV_SHOW +exec_test 'export TEST=LOL ; echo $TEST$TEST$TEST=lol$TEST' +exec_test 'export TEST=LOL; export TEST+=LOL ; echo $TEST ;' $ENV_SHOW +exec_test $ENV_SHOW +exec_test $EXPORT_SHOW +exec_test 'export TEST="ls -l - a" ; echo $TEST ; $LS ; ' $ENV_SHOW + +# REDIRECTIONS +exec_test 'echo test > ls ; cat ls' +exec_test 'echo test > ls >> ls >> ls ; echo test >> ls; cat ls' +exec_test '> lol echo test lol; cat lol' +exec_test '>lol echo > test>lol>test>>lol>test mdr >lol test >test; cat test' +exec_test 'cat < ls' +exec_test 'cat < ls > ls' + +# MULTI TESTS +exec_test 'echo testing multi ; echo "test 1 ; | and 2" ; cat tests/lorem.txt | grep Lorem' + +# SYNTAX ERROR +exec_test ';; test' +exec_test '| test' +exec_test 'echo > <' +exec_test 'echo | |' +exec_test '<' + +# EXIT +exec_test "exit 42" +exec_test "exit 42 53 68" +exec_test "exit 259" +exec_test "exit 9223372036854775807" +exec_test "exit -9223372036854775808" +exec_test "exit 9223372036854775808" +exec_test "exit -9223372036854775810" +exec_test "exit -4" +exec_test "exit wrong" +exec_test "exit wrong_command" +exec_test "gdagadgag" +exec_test "ls -Z" +exec_test "cd gdhahahad" +exec_test "ls -la | wtf" + +rm lol ls test