From afc993e26513ed4ba1f87efa1a60ef484440f6be Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 4 Jul 2024 14:51:38 -0500 Subject: [PATCH] Test failure as well as success, and can't use toyonly with NOHELP. --- tests/test.test | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test.test b/tests/test.test index 216522f7..185eab8b 100644 --- a/tests/test.test +++ b/tests/test.test @@ -117,8 +117,11 @@ touch oldfile -d 1970-01-01 touch newfile -d 2031-01-01 testcmd "-ef" "newfile -ef newfile && echo yes" "yes\n" "" "" +testcmd "-ef2" "newfile -ef oldfile || echo no" "no\n" "" "" testcmd "-ot" "oldfile -ot newfile && echo yes" "yes\n" "" "" +testcmd "-ot2" "oldfile -ot oldfile || echo no" "no\n" "" "" testcmd "-nt" "newfile -nt oldfile && echo yes" "yes\n" "" "" +testcmd "-nt2" "oldfile -nt newfile || echo no" "no\n" "" "" testing "positional" "test -a == -a && echo yes" "yes\n" "" "" testing "! stacks" 'test \! \! \! \! 2 -eq 2 && echo yes' "yes\n" "" "" @@ -128,10 +131,12 @@ testing "<1" 'test abc \< def && echo yes' "yes\n" "" "" testing "<2" 'test def \< abc || echo yes' "yes\n" "" "" testing ">1" 'test abc \> def || echo yes' "yes\n" "" "" testing ">2" 'test def \> abc && echo yes' "yes\n" "" "" + +# toyonly doesn't work with TOYFLAG_NOHELP # bash only has this for [[ ]] but extra tests to _exclude_ silly... -toyonly testcmd "=~" 'abc =~ a.c && echo yes' "yes\n" "" "" -toyonly testcmd "=~ fail" 'abc =~ d.c; echo $?' '1\n' "" "" -toyonly testcmd "=~ zero length match" 'abc =~ "1*" && echo yes' 'yes\n' '' '' +#toyonly testcmd "=~" 'abc =~ a.c && echo yes' "yes\n" "" "" +#toyonly testcmd "=~ fail" 'abc =~ d.c; echo $?' '1\n' "" "" +#toyonly testcmd "=~ zero length match" 'abc =~ "1*" && echo yes' 'yes\n' '' '' # test ! = -o a # test ! \( = -o a \) -- 2.39.2