mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 11:47:04 +08:00
tests/test_util: Fix wrong argument in delta
This spewed errors because the `math` invocation got no second operand: Testing file checks/sigint.fish ... math: Error: Too few arguments '1571487730 -' but only if the `date` didn't do milliseconds, which is the case on FreeBSD and NetBSD. (also force the variable to be global - we don't want to have a universal causing trouble here)
This commit is contained in:
parent
fc0c39b6fd
commit
e0d623d4b7
|
@ -137,7 +137,7 @@ end
|
|||
# lame timer
|
||||
for program in {g,}date
|
||||
if command -q $program && $program --version 1>/dev/null 2>/dev/null
|
||||
set milli $program
|
||||
set -g milli $program
|
||||
set unit ms
|
||||
break
|
||||
else
|
||||
|
@ -154,5 +154,5 @@ end
|
|||
function delta
|
||||
set -q milli[1]
|
||||
and math "( "($milli +%s%3N)" - $argv[1])"
|
||||
or math (date +%s) - $starttime
|
||||
or math (date +%s) - $argv[1]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user