Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test/scripts
diff options
context:
space:
mode:
authorEthan Sommer <e5ten.arch@gmail.com>2019-11-04 23:36:02 -0500
committerAllan McRae <allan@archlinux.org>2019-11-05 14:47:15 +1000
commit1bfae7d14a7bdad777e82912c5c6883deb11aee5 (patch)
treea41965597b631f363d36c943cceb4694f151469d /test/scripts
parent091b244d0ffa281ba9968606184d709e59c2a2d5 (diff)
libmakepkg: fix empty arguments in parseopts
Previously parseopts checked if there was an argument by checking that the string was non-empty, resulting in empty arguments being incorrectly considered non-existent. This change makes parseopts check if arguments exist at all, rather than checking that they are non-empty Signed-off-by: Ethan Sommer <e5ten.arch@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/scripts')
-rwxr-xr-xtest/scripts/parseopts_test.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh
index 8f1ea1f3..3d706be8 100755
--- a/test/scripts/parseopts_test.sh
+++ b/test/scripts/parseopts_test.sh
@@ -31,7 +31,7 @@ tap_parse() {
unset OPTRET
}
-tap_plan 54
+tap_plan 56
# usage: tap_parse <expected result> <token count> test-params...
# a failed tap_parse will match only the end of options marker '--'
@@ -117,4 +117,7 @@ tap_parse '--opt= --opt=foo --opt --' 4 --opt= --opt=foo --opt
# short opt with and without optional arg, and non-option arg
tap_parse '-b=foo -A -b -- foo' 5 -bfoo -Ab foo
+# all possible ways to specify empty optargs
+tap_parse '--key --pkg -p --' 7 --key '' --pkg='' -p ''
+
tap_finish