From 296a75aa8028f374730a495e83bb5c73518d4f9a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 23 Aug 2022 15:53:42 -0700 Subject: [PATCH] Fix the seq and sort tests on macOS and Android. seq has a test that uses timeout (which isn't available on macOS), and sort had tests that used |& which is a modern bashism (which isn't in macOS' old bash, and Android uses mksh rather than bash). This doesn't fix the tar tests for macOS, so macOS CI will still be broken, but that's a separate issue, and this will fix Android CI. --- tests/seq.test | 2 ++ tests/sort.test | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/seq.test b/tests/seq.test index 05d9b1e9..6b80e6ac 100755 --- a/tests/seq.test +++ b/tests/seq.test @@ -73,4 +73,6 @@ testing "invalid increment" "seq 1 1f 1 2>/dev/null || echo y" "y\n" "" "" testing "INT_MIN" "seq -2147483648 -2147483647" "-2147483648\n-2147483647\n"\ "" "" +# macOS doesn't include a timeout(1), nor a good alternative. +skipnot [ "$(uname)" != "Darwin" ] testing "fast path" "timeout 10 seq 10000000 > /dev/null" "" "" "" diff --git a/tests/sort.test b/tests/sort.test index d33a258d..dbb6ca08 100755 --- a/tests/sort.test +++ b/tests/sort.test @@ -104,8 +104,8 @@ toyonly testing "-kx" "sort -k1,1x" "3\na\n0c\n" "" "0c\na\n3\n" # "toy-2.37.tar.gz\ntoy-3.4.tar.gz\ntoy-3.12.tar.gz\ntoy-4.16-rc2.tar.gz\ntoy-4.16.tar.gz\n" "" \ # "toy-3.12.tar.gz\ntoy-2.37.tar.gz\ntoy-3.4.tar.gz\ntoy-4.16-rc2.tar.gz\ntoy-4.16.tar.gz" -testcmd "-c" "-c |& grep -o [0-9]*" "3\n" "" "a\nb\na\nc" -testcmd "-uc" "-uc |& grep -o [0-9]*" "3\n" "" "a\nb\nb\nc" +testcmd "-c" "-c 2>&1 | grep -o [0-9]*" "3\n" "" "a\nb\na\nc" +testcmd "-uc" "-uc 2>&1 | grep -o [0-9]*" "3\n" "" "a\nb\nb\nc" testcmd "-C 1" "-C || echo yes" "yes\n" "" "one\ntwo\nthree" testcmd "-C 2" "-C && echo yes" "yes\n" "" "a\nb\nc\n" -- 2.39.2