mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 03:21:16 -03:00
tests/functions: Don't compare diff output
Turns out busybox diff (used on alpine) defaults to unified output, which we can't use because that prints filenames, and those are tempfiles made by psub. Instead, we use builtins to print the first line and compare the others.
This commit is contained in:
@@ -43,8 +43,18 @@ functions -q name3a
|
||||
or echo "Function name3a not found as expected"
|
||||
|
||||
logmsg Checking that the copied functions are identical other than the name
|
||||
diff (functions name1 | psub) (functions name1a | psub)
|
||||
diff (functions name3 | psub) (functions name3a | psub)
|
||||
# Poor man's diff because on some systems diff defaults to unified output, but that prints filenames.
|
||||
#
|
||||
set -l name1 (functions name1)
|
||||
set -l name1a (functions name1a)
|
||||
set -l name3 (functions name3)
|
||||
set -l name3a (functions name3a)
|
||||
echo $name1[1]
|
||||
echo $name1a[1]
|
||||
test "$name1[2..-1]" = "$name1a[2..-1]"; and echo "1 = 1a"
|
||||
echo $name3[1]
|
||||
echo $name3a[1]
|
||||
test "$name3[2..-1]" = "$name3a[2..-1]"; and echo "3 = 3a"
|
||||
|
||||
logmsg Checking reserved names
|
||||
function test; echo banana; end
|
||||
|
||||
@@ -62,14 +62,12 @@ Function name4 not found as expected
|
||||
|
||||
####################
|
||||
# Checking that the copied functions are identical other than the name
|
||||
1c1
|
||||
< function name1 --argument arg1 arg2
|
||||
---
|
||||
> function name1a --argument arg1 arg2
|
||||
1c1
|
||||
< function name3 --argument arg1 arg2
|
||||
---
|
||||
> function name3a --argument arg1 arg2
|
||||
function name1 --argument arg1 arg2
|
||||
function name1a --argument arg1 arg2
|
||||
1 = 1a
|
||||
function name3 --argument arg1 arg2
|
||||
function name3a --argument arg1 arg2
|
||||
3 = 3a
|
||||
|
||||
####################
|
||||
# Checking reserved names
|
||||
|
||||
Reference in New Issue
Block a user