mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
export: set correct exit status
This commit is contained in:
parent
3cdf7c3f76
commit
ba4192bf8d
2 changed files with 9 additions and 1 deletions
6
test.sh
6
test.sh
|
|
@ -307,25 +307,31 @@ EXTRAENV=-i
|
|||
when_run <<EOF "export with strange inputs"
|
||||
export PATH=$PATH
|
||||
export var
|
||||
echo status=\$?
|
||||
echo var=[\$var]
|
||||
export blue=
|
||||
echo status=\$?
|
||||
echo blue=[\$blue]
|
||||
env -u PATH env
|
||||
EOF
|
||||
expecting <<EOF
|
||||
status=0
|
||||
var=[]
|
||||
status=0
|
||||
blue=[]
|
||||
blue=
|
||||
EOF
|
||||
|
||||
when_run <<"EOF" "export with invalid identifiers"
|
||||
export = 123=456 hello=hi 456=789
|
||||
echo status=$?
|
||||
echo hello=$hello
|
||||
EOF
|
||||
expecting <<"EOF"
|
||||
minishell: export: `=': not a valid identifier
|
||||
minishell: export: `123=456': not a valid identifier
|
||||
minishell: export: `456=789': not a valid identifier
|
||||
status=1
|
||||
hello=hi
|
||||
EOF
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue