tests/psub: Don't use grep -o and diff -q

These aren't available on OpenIndiana.

`grep -o` is easily changed to `string`, `diff -q` imitated with
`comm` and `test`.

See #5472.
This commit is contained in:
Fabian Homborg 2019-01-02 20:54:14 +01:00
parent 380bae80bf
commit f3e87b7996

View File

@ -30,14 +30,14 @@ else
end
# The --file flag is the default behavior.
if count (echo foo | psub -s .cc | grep -o '\.cc$') >/dev/null
if count (echo foo | psub -s .cc | string match -r '\.cc$') >/dev/null
echo 'psub filename ends with .cc'
else
echo 'psub filename does not end with .cc'
end
# Make sure we get the same result if we explicitly ask for a temp file.
if count (echo foo | psub -f -s .cc | grep -o '\.cc$') >/dev/null
if count (echo foo | psub -f -s .cc | string match -r '\.cc$') >/dev/null
echo 'psub filename ends with .cc'
else
echo 'psub filename does not end with .cc'
@ -50,4 +50,5 @@ else
echo 'psub directory was deleted'
end
diff -q (__fish_print_help psub | psub) (psub -hs banana | psub)
set -l diffs (comm -3 (__fish_print_help psub | psub) (psub -hs banana | psub))
test -z "$diffs"