mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
tests: ensure some more specific tests work
This commit is contained in:
parent
826abdf623
commit
58a27d712b
1 changed files with 77 additions and 0 deletions
77
test.sh
77
test.sh
|
|
@ -1610,4 +1610,81 @@ expecting <<EOF
|
||||||
minishell: *.txt: ambiguous redirect
|
minishell: *.txt: ambiguous redirect
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
when_run <<EOF "writing to /dev/full"
|
||||||
|
echo hi > /dev/full
|
||||||
|
echo \$?
|
||||||
|
pwd > /dev/full
|
||||||
|
echo \$?
|
||||||
|
env > /dev/full
|
||||||
|
echo \$?
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
minishell: echo: write error: No space left on device
|
||||||
|
1
|
||||||
|
minishell: pwd: write error: No space left on device
|
||||||
|
1
|
||||||
|
minishell: env: write error: No space left on device
|
||||||
|
125
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<EOF "writing to /root"
|
||||||
|
echo hi > /root/minishell.tmp
|
||||||
|
echo \$?
|
||||||
|
pwd > /root/minishell.tmp
|
||||||
|
echo \$?
|
||||||
|
env > /root/minishell.tmp
|
||||||
|
echo \$?
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
minishell: /root/minishell.tmp: Permission denied
|
||||||
|
1
|
||||||
|
minishell: /root/minishell.tmp: Permission denied
|
||||||
|
1
|
||||||
|
minishell: /root/minishell.tmp: Permission denied
|
||||||
|
1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<EOF "redirection: same file for input and output"
|
||||||
|
cat < hello.txt > hello.txt
|
||||||
|
echo \$?
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
minishell: hello.txt: No such file or directory
|
||||||
|
1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<EOF "redirection: same file for output and input"
|
||||||
|
cat > hello.txt < hello.txt
|
||||||
|
echo \$?
|
||||||
|
ls
|
||||||
|
cat hello.txt
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
0
|
||||||
|
hello.txt
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<"EOF" "null expansions"
|
||||||
|
echo hi $NOOOOOOOOOOOOOOOOOOOOOOO hello
|
||||||
|
echo hi "" hello
|
||||||
|
echo hi "$NOOOOOOOOOOOOOOOOOOOOOOO" hello
|
||||||
|
echo hi a$NOOOOOOOOOOOOOOOOOOOOOOO hello
|
||||||
|
echo hi ""$NOOOOOOOOOOOOOOOOOOOOOOO hello
|
||||||
|
echo hi $NOOOOOOOOOOOOOOOOOOOOOOO"" hello
|
||||||
|
echo hi '' hello
|
||||||
|
echo hi ''$NOOOOOOOOOOOOOOOOOOOOOOO hello
|
||||||
|
echo hi $NOOOOOOOOOOOOOOOOOOOOOOO'' hello
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
hi a hello
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
hi hello
|
||||||
|
EOF
|
||||||
|
|
||||||
finalize
|
finalize
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue