mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 20:16:12 +08:00
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:
parent
380bae80bf
commit
f3e87b7996
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user