mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
feat(builtins/cd): on error, print path
This commit is contained in:
parent
29bbb5e572
commit
9fcb34e1d5
2 changed files with 21 additions and 6 deletions
14
test.sh
14
test.sh
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue