From 3b3e90714f4171d88c983dfe55c581d6265215e4 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 28 Jul 2020 06:31:27 +0430 Subject: [PATCH] Shell: Add tests for '&&' and '||' parsing and evaluation --- Shell/Tests/valid.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Shell/Tests/valid.sh b/Shell/Tests/valid.sh index 4676aaee54..27f02bc128 100644 --- a/Shell/Tests/valid.sh +++ b/Shell/Tests/valid.sh @@ -5,6 +5,13 @@ true || exit 2 false && exit 2 +# Can we chain &&'s? +false && exit 2 && echo "can't chain &&'s" && exit 2 + +# Proper precedence between &&'s and ||'s +false && exit 2 || true && false && exit 2 + + # Sanity check: can we pass arguments to 'test'? test yes = yes || exit 2