Parcourir la source

Shell: Add tests for '&&' and '||' parsing and evaluation

AnotherTest il y a 5 ans
Parent
commit
3b3e90714f
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      Shell/Tests/valid.sh

+ 7 - 0
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