mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix(builtin/export): show error on invalid identifiers such as % and $
This commit is contained in:
parent
efaf4708f9
commit
c5e15903e0
2 changed files with 27 additions and 9 deletions
15
test.sh
15
test.sh
|
|
@ -749,10 +749,25 @@ EOF
|
|||
|
||||
when_run <<EOF "export with empty arguments"
|
||||
export "" ""
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<"EOF"
|
||||
minishell: export: `': not a valid identifier
|
||||
minishell: export: `': not a valid identifier
|
||||
1
|
||||
EOF
|
||||
|
||||
when_run <<EOF "export with invalid identifiers"
|
||||
export % $ 0 1 \$?
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<"EOF"
|
||||
minishell: export: `%': not a valid identifier
|
||||
minishell: export: `$': not a valid identifier
|
||||
minishell: export: `0': not a valid identifier
|
||||
minishell: export: `1': not a valid identifier
|
||||
minishell: export: `0': not a valid identifier
|
||||
1
|
||||
EOF
|
||||
|
||||
finalize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue