From e0d623d4b72df889de2c64c2813c659ab43ce2ac Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 19 Oct 2019 14:25:03 +0200 Subject: [PATCH] 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) --- tests/test_util.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_util.fish b/tests/test_util.fish index 5d6ce8840..53c2b438d 100644 --- a/tests/test_util.fish +++ b/tests/test_util.fish @@ -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