└── ReadMe.md /ReadMe.md: -------------------------------------------------------------------------------- 1 | # Minishell tests 2 | 3 | Here are some tests for the minishell project of school 42 cursus. It's not exaustive, so don't limit yourself with this tests. 4 | These tests are not all mines. Credits to vgoldman, mashar, and jecaudal. 5 | 6 | tmarx 7 | # Tests 8 | 9 | - [ ] echo bonjour ; | 10 | - [ ] echo bonjour | | 11 | - [ ] | 12 | - [ ] echo bonjour |; 13 | - [ ] echo bonjour \; ls 14 | - [ ] echo bonjour > test\ 1 15 | - [ ] cd $HOME/Documents 16 | - [ ] echo "\s" & echo "\\s" 17 | - [ ] echo \> 18 | - [ ] echo -n -n -nnnn -nnnnm 19 | - [ ] cat /dev/random | head -n 1 | cat -e 20 | - [ ] unset var1 # with undefined var1 21 | - [ ] export "" et unset "" 22 | - [ ] echo test > file test1 23 | - [ ] $ 24 | - [ ] not_cmd bonjour > salut 25 | - [ ] env puis export puis env # vars aren't sorted 26 | - [ ] cat Makefile | grep pr | head -n 5 | cd test (mybin) # check status code 27 | - [ ] cat Makefile | grep pr | head -n 5 | cat test (bin) # check status code 28 | - [ ] cat Makefile | grep pr | head -n 5 | hello (NA) # check status code 29 | - [ ] echo bonjour >>> test 30 | - [ ] echo bonjour > > out 31 | - [ ] echo 2 >> out1 > out2 32 | - [ ] echo 2 > out1 >> out2 33 | - [ ] cat < test # with non-existent test 34 | - [ ] export var; export var=test 35 | - [ ] echo bonjour > $test # with test not defined 36 | - [ ] file_name_in_current_dir 37 | - [ ] cd ../../../../../.. ; pwd 38 | - [ ] ctrl-C . 130 sur bin(ex : sleep 10)&line vide 39 | - [ ] ctrl-\ .131 sur bin 40 | - [ ] echo "bip | bip ; coyotte > < \" " 41 | - [ ] cat | cat | cat | ls # check outputs order 42 | - [ ] $bla # with bla not defined 43 | - [ ] export var ="cat Makefile | grep >" 44 | - [ ] export "test=ici"=coucou 45 | - [ ] c$var Makefile # with var=at 46 | - [ ] $LESS$VAR 47 | - [ ] /bin/echo bonjour 48 | - [ ] not_cmd 49 | - [ ] sleep 5 | exit 50 | - [ ] echo bonjour > $test w/ t 51 | - [ ] "exit retour a la ligne" 52 | - [ ] minishell # binary not in path without "./" before 53 | - [ ] cat diufosgid # check exit code 54 | - [ ] exit # should return the last exit code value 55 | - [ ] exit -10 56 | - [ ] exit +10 57 | - [ ] ; 58 | - [ ] echo coucou | ; 59 | - [ ] echo "$HOME" 60 | - [ ] echo '$HOME' 61 | - [ ] export ; env # display is different for both commands 62 | - [ ] echo \$HOME 63 | - [ ] > log echo coucou 64 | - [ ] echo hudifg d | | hugdfihd 65 | - [ ] echo 66 | - [ ] echo simple 67 | - [ ] echo -n simple 68 | - [ ] echo '\' 69 | - [ ] echo "\" 70 | - [ ] echo "\\" 71 | - [ ] echo "\n \n \n" 72 | - [ ] echo "\n \\n \\\n" 73 | - [ ] echo ;; 74 | - [ ] echo hi";" hihi 75 | - [ ] echo hi " ; " hihi 76 | - [ ] cd 77 | - [ ] cd . 78 | - [ ] cd ~ 79 | - [ ] cd / 80 | - [ ] cd no_file 81 | - [ ] cd a b c d 82 | - [ ] pwd a 83 | - [ ] pwd a b c d 84 | - [ ] export LOL=lala ROR=rara 85 | - [ ] unset LOL ROR 86 | - [ ] export "HI= hi" 87 | - [ ] export "HI =hi" 88 | - [ ] /bin/ls 89 | - [ ] # write something the press ctrl+c 90 | - [ ] # write something then press ctrl+d 91 | - [ ] # write something then press ctrl+\ 92 | - [ ] echo $? 93 | - [ ] l^Ds 94 | - [ ] echo | 95 | - [ ] | echo 96 | - [ ] sort | ls # check output order 97 | - [ ] cat < > 98 | - [ ] cat < < 99 | - [ ] cat > > 100 | - [ ] > a ls > b < Makefile 101 | - [ ] echo > a Hello World! 102 | - [ ] > a echo Hello World! 103 | - [ ] cat < Makefile | grep gcc > output 104 | - [ ] exit 0 | exit 1 105 | - [ ] exit 1 | exit 0 --------------------------------------------------------------------------------