mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
builtins: cd: implement cd to absolute paths
This commit is contained in:
parent
5ce4a2b85f
commit
e93e6efb93
6 changed files with 69 additions and 8 deletions
22
test.sh
22
test.sh
|
|
@ -160,22 +160,34 @@ expecting <<EOF
|
|||
/tmp/dir.minishell
|
||||
EOF
|
||||
|
||||
when_run <<EOF "pwd works in any directory"
|
||||
when_run <<EOF "pwd works in any directory, can cd to absolute paths"
|
||||
mkdir test
|
||||
cd test
|
||||
cd /tmp/dir.minishell/test
|
||||
pwd
|
||||
mkdir hi
|
||||
cd hi
|
||||
cd /tmp/dir.minishell/test/hi
|
||||
pwd
|
||||
cd ..
|
||||
cd /tmp/dir.minishell/test
|
||||
pwd
|
||||
EOF
|
||||
todo <<EOF
|
||||
expecting <<EOF
|
||||
/tmp/dir.minishell/test
|
||||
/tmp/dir.minishell/test/hi
|
||||
/tmp/dir.minishell/test
|
||||
EOF
|
||||
|
||||
when_run <<EOF "cd will print error when going into a directory with no access"
|
||||
mkdir test
|
||||
chmod -x test
|
||||
cd test
|
||||
pwd
|
||||
chmod +x test
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: cd: Permission denied
|
||||
/tmp/dir.minishell
|
||||
EOF
|
||||
|
||||
when_run <<EOF "quoted parentheses are not operators"
|
||||
echo unclosed '('
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue