From 613ecfc7e4d687c1aff47e1e59593cff24ab57ed Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 16 Sep 2022 18:58:21 -0500 Subject: [PATCH] Fix pre-epoch test workaround It turns out that not all systems print an unsigned integer as the output of `stat -c %Y xxx` and the leading `-` can be misinterpreted as a parameter to `string match`. --- tests/checks/test.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/checks/test.fish b/tests/checks/test.fish index b7f1ed6f8..bd88e52c3 100644 --- a/tests/checks/test.fish +++ b/tests/checks/test.fish @@ -66,7 +66,7 @@ touch -m -t 190212112045.40 old touch -m -t 190112112040.39 oldest touch -m -t 203801080314.07 newest -if string match -qr '^(0|'(stat -c %Y epoch)')$' (stat -c %Y oldest) +if string match -qr '^(0|'(stat -c %Y epoch)')$' -- (stat -c %Y oldest) # Filesystem does not support dates older than epoch, so silently skip this test - there's no # guarantee that an FS supports pre-epoch timestamps and lxfs (virtual WSLv1 fs) doesn't. else