NB: Works on macOS only, not Ubuntu. I'll work on it later, or you are welcome to contribute as well :)
A simple Minishell tester, it checks your output and your exit status are similar to the bash or not also it checks it compare your return errors else it returns where's your wrong see :
./tester.sh --help
How To Use a Minishell_Tester :
1️⃣ Put your path in here:
2️⃣ Go to your Makefile and make sure to not insert any flags for readline only -lreadline :
3️⃣ Check if there's any rl_replace_line and make sure to comment it :
4️⃣ If you print any of thoses please comment them and that's it:
git clone https://github.com/Toufa7/Minishell_Tester.git
cd Minishell_Tester
chmod +x tester.sh
./tester.sh -options
./tester.sh [-h|--help|a|E|e|p|u|x]
-
The following options are available:
- h or --help Help
- a All
- c Cd
- E Echo
- e Export
- p Pipes
- u Unset
- x Exit
🤝 Feel free to use it, contribute and add your crazy tests
TODO: ✅❓
--> execution
[✅] expanding in herdoc
[✅] cntrl_c in herdoc
[✅] var without value should not displayed in env cmd
[✅] error not displayed when error when giving dir as cmd
[✅] update exit status
[✅] Reset Exit status to 0 on success
[✅] pwd in a removed dir and unseted path
[✅] cat | ls : Try to press ok or redirections: Solution => Stop when the user hit enter: Solution simply Try Another Terminal
[✅] Empty cmd should not display cmd not found
[✅] do not add PWD and OLDPWD in mcd() Function
[✅] All s_redirections in one array
[✅] echo hello > file You should write the output in the file
[✅] export > file.txt == SEGV
[✅] cat Makefile > outfile.txt < input > outfile_error.txt no such file called input so you should stop a the error file : Solution => Exit in Child Process (if you found an error)
[✅] < Makdbvbefile << ss cat : You should stop at the error : Solution => Exit in Child Process
[✅] ambiguous redirect when the file redercs in NULL
[❓] cat << ss --> Ctrl + C --> exit 130
[❓] ctr \ -> quit --> exit 131 and CTRL+C retur status it's 1 not 0
[❓] cd = Bad Address
[❓] unset PATH && cmd : Expected = error msg and exit child process
[❓] echo test > b | << lim | << lim2 creates b before finishing all heredocs: Expected = wait until all heredocs finished
[❓] echo test >
---> Parser
[✅] if the delimiter has quotes don't expand
[✅] $fghjm << ls --> cmd should be NUll and ls | "" --> cmd should be empty string : Solution => Simply check if the upcoming input length is 0
[✅] $NOTEXIT ls --> it should run ls
[✅] cat << "'"
[✅] echo ''"'"
[✅] Using get_var_index to get variables from our env
[❓] $NONEXIT cmd
[❓] When the variables in case of > >> <
[❓] $NONEXIT return it $UGD => $UGD
[✅] Mixing tabs with spaces: Done but check :
[❓] export a="ls -la"
[❓] echo $123
[✅] echo "$USER ' ' 'imad ok"
[❓] echo "$" = expected = $
[❓] echo $"test"$ : Expected = test$
[❓] echo '$' : Expected = $
[❓] env ls => not required
[❓] pipes: check syntax errors
*/