]> granicus.if.org Git - jq/commitdiff
Add more tests for any and all
authorMuh Muhten <muh.muhten@gmail.com>
Sun, 24 Feb 2019 00:47:51 +0000 (19:47 -0500)
committerNico Williams <nico@cryptonector.com>
Tue, 26 Feb 2019 17:05:25 +0000 (11:05 -0600)
tests/jq.test

index f330fb0f6d51879e3c24ee4544838faf71822e0c..539ee7d8323fbd9ea912a2ac329cba6afe05aab8 100644 (file)
@@ -851,6 +851,51 @@ false
 [1,2,3,4,true]
 true
 
+# Check short-circuiting
+any(true, error; .)
+"badness"
+true
+
+all(false, error; .)
+"badness"
+false
+
+any(not)
+[]
+false
+
+all(not)
+[]
+true
+
+any(not)
+[false]
+true
+
+all(not)
+[false]
+true
+
+[any,all]
+[]
+[false,true]
+
+[any,all]
+[true]
+[true,true]
+
+[any,all]
+[false]
+[false,false]
+
+[any,all]
+[true,false]
+[true,false]
+
+[any,all]
+[null,null,true]
+[true,false]
+
 #
 # Paths
 #