feat(builtins/cd): on error, print path

This commit is contained in:
Khaïs COLIN 2025-04-25 16:02:58 +02:00
parent 29bbb5e572
commit 9fcb34e1d5
2 changed files with 21 additions and 6 deletions

14
test.sh
View file

@ -243,11 +243,13 @@ when_run <<EOF "cd will print error when going into a directory with no access"
mkdir test
chmod -x test
cd test
echo \$?
pwd
chmod +x test
EOF
expecting <<EOF
minishell: cd: Permission denied
minishell: cd: test: Permission denied
1
/tmp/dir.minishell
EOF
@ -1225,4 +1227,14 @@ minishell: qwertyuiop: command not found
minishell: qwertyuiop: command not found
EOF
when_run <<EOF "cd into a file"
touch file
cd file
echo \$?
EOF
expecting <<EOF
minishell: cd: file: Not a directory
1
EOF
finalize