-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(builtins): fix set builtin handling of - and -- (#354)
- Loading branch information
Showing
2 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,41 @@ | ||
name: "Builtins: set" | ||
cases: | ||
- name: "set with no args" | ||
stdin: | | ||
MYVARIABLE=VALUE | ||
set > set-output.txt | ||
grep MYVARIABLE set-output.txt | ||
# Remove set-output.txt to avoid it being byte-for-byte compared. | ||
rm set-output.txt | ||
- name: "Basic set usage" | ||
stdin: | | ||
set a b c d | ||
echo ${*} | ||
- name: "set clearing args" | ||
stdin: | | ||
set a b c | ||
echo ${*} | ||
set a | ||
echo ${*} | ||
- name: "set with -" | ||
stdin: | | ||
set - a b c | ||
echo "args: " ${*} | ||
set - | ||
echo "args: " ${*} | ||
- name: "set with --" | ||
stdin: | | ||
set -- a b c | ||
echo "args: " ${*} | ||
set -- | ||
echo "args: " ${*} | ||
- name: "set with option-looking tokens" | ||
stdin: | | ||
set a -v | ||
echo ${*} |