mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
cd: ensure relative paths work as expected
This commit is contained in:
parent
f1b2e1e22d
commit
a66b71e5ce
1 changed files with 32 additions and 0 deletions
32
test.sh
32
test.sh
|
|
@ -227,6 +227,38 @@ expecting <<EOF
|
|||
/tmp/dir.minishell
|
||||
EOF
|
||||
|
||||
when_run <<EOF "cd with simple relative paths"
|
||||
mkdir test
|
||||
cd test
|
||||
pwd
|
||||
cd ..
|
||||
pwd
|
||||
EOF
|
||||
expecting <<EOF
|
||||
/tmp/dir.minishell/test
|
||||
/tmp/dir.minishell
|
||||
EOF
|
||||
|
||||
when_run <<EOF "cd with complicated relative paths"
|
||||
mkdir -p test/hello/there
|
||||
mkdir -p test/hi/there
|
||||
mkdir -p test/hello/world
|
||||
cd test/hello/there
|
||||
pwd
|
||||
cd ../../hi
|
||||
pwd
|
||||
cd ../hi/../hi/../hi/../hi
|
||||
pwd
|
||||
cd ../hi/../hi/../hi/../hi/../../test/hello/world
|
||||
pwd
|
||||
EOF
|
||||
expecting <<EOF
|
||||
/tmp/dir.minishell/test/hello/there
|
||||
/tmp/dir.minishell/test/hi
|
||||
/tmp/dir.minishell/test/hi
|
||||
/tmp/dir.minishell/test/hello/world
|
||||
EOF
|
||||
|
||||
when_run <<EOF "quoted parentheses are not operators"
|
||||
echo unclosed '('
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue