diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-13 17:15:03 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-13 17:15:03 (EDT) |
commit | e6b04d9ffd8bef2482ab61957c138ae92527206d (patch) | |
tree | f70b0b04037b1a537331eed3c6d4c397c84de5d3 /tests | |
parent | 2ddb616b87a2a4684d03c9b54e95f800e73017d9 (diff) |
Protect [ commands from strings beginning with "-"
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/ob_parse_dep.sh | 2 | ||||
-rwxr-xr-x | tests/ob_reduce_deps.sh | 44 |
2 files changed, 23 insertions, 23 deletions
diff --git a/tests/ob_parse_dep.sh b/tests/ob_parse_dep.sh index 2ee6cbf..887f6f1 100755 --- a/tests/ob_parse_dep.sh +++ b/tests/ob_parse_dep.sh @@ -40,7 +40,7 @@ testcase() for comp in pkg archqual rel ver arches; do test_comp="$(eval "printf '%s' \"\${test_${comp}}\"")" good_comp="$(eval "printf '%s' \"\${${comp}}\"")" - if [ "${test_comp}" != "${good_comp}" ]; then + if [ x"${test_comp}" != x"${good_comp}" ]; then diag_ "$(printf 'Dependency "%s", component "%s":' \ "${dep}" "${comp}")" diag_ "$(printf ' "%s" != "%s"\n' \ diff --git a/tests/ob_reduce_deps.sh b/tests/ob_reduce_deps.sh index 833f8de..7030f07 100755 --- a/tests/ob_reduce_deps.sh +++ b/tests/ob_reduce_deps.sh @@ -28,107 +28,107 @@ plan_ 11 command_ok_ \ 'NORMAL LIST "foo, bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo, bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] command_ok_ \ 'NORMAL LIST "foo,bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo,bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] command_ok_ \ 'NORMAL LIST "foo, bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo, bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] command_ok_ \ 'UNION LIST "foo, bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -u \ -a 'amd64-linux-glibc' \ 'foo, bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] command_ok_ \ 'UNION LIST "foo,bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -u \ -a 'amd64-linux-glibc' \ 'foo,bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] command_ok_ \ 'UNION LIST "foo, bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -u \ -a 'amd64-linux-glibc' \ 'foo, bar' \ )" = \ - 'foo, bar' \ + x'foo, bar' \ ] # Normal OR-lists. command_ok_ \ 'NORMAL LIST "foo | bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo | bar' \ )" = \ - 'foo | bar' \ + x'foo | bar' \ ] command_ok_ \ 'NORMAL LIST "foo|bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo|bar' \ )" = \ - 'foo | bar' \ + x'foo | bar' \ ] command_ok_ \ 'NORMAL LIST "foo | bar"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo | bar' \ )" = \ - 'foo | bar' \ + x'foo | bar' \ ] # Normal and union AND-lists with arch specs. command_ok_ \ 'NORMAL LIST "foo [amd64-linux-glibc], bar [!amd64-linux-glibc]"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -a 'amd64-linux-glibc' \ 'foo [amd64-linux-glibc], bar [!amd64-linux-glibc]' \ )" = \ - 'foo' \ + x'foo' \ ] command_ok_ \ 'UNION LIST "foo [amd64-linux-glibc], bar [!amd64-linux-glibc]"' -- \ - [ "$(ob_reduce_deps \ + [ x"$(ob_reduce_deps \ -u \ -a 'amd64-linux-glibc' \ 'foo [amd64-linux-glibc], bar [!amd64-linux-glibc]' \ )" = \ - 'foo' \ + x'foo' \ ] |