From 783c7a56abffc8c56c5738e5b70b0d788b6ef1f2 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Fri, 12 Sep 2025 10:54:18 +0200 Subject: [PATCH] spec: add test case for boolean inequality --- biscuit-auth/examples/testcases.rs | 4 +++- biscuit-auth/samples/README.md | 4 +++- biscuit-auth/samples/samples.json | 5 +++-- biscuit-auth/samples/test028_expressions_v4.bc | Bin 388 -> 416 bytes 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/biscuit-auth/examples/testcases.rs b/biscuit-auth/examples/testcases.rs index 24d6ec3d..fd8d6f8c 100644 --- a/biscuit-auth/examples/testcases.rs +++ b/biscuit-auth/examples/testcases.rs @@ -1991,11 +1991,13 @@ fn expressions_v4(target: &str, root: &KeyPair, test: bool) -> TestResult { let biscuit = biscuit!( r#" + //bool not strict equal + check if true !== false; //integer not strict equal check if 1 !== 3; //integer bitwise and or xor check if 1 | 2 ^ 3 === 0; - // string not strict equal + //string not strict equal check if "abcD12x" !== "abcD12"; //date not strict equal check if 2022-12-04T09:46:41+00:00 !== 2020-12-04T09:46:41+00:00; diff --git a/biscuit-auth/samples/README.md b/biscuit-auth/samples/README.md index a0907504..16715eac 100644 --- a/biscuit-auth/samples/README.md +++ b/biscuit-auth/samples/README.md @@ -2460,6 +2460,7 @@ public keys: [] block version: 4 ``` +check if true !== false; check if 1 !== 3; check if 1 | 2 ^ 3 === 0; check if "abcD12x" !== "abcD12"; @@ -2476,7 +2477,7 @@ allow if true; ``` revocation ids: -- `117fa653744c859561555e6a6f5990e3a8e7817f91b87aa6991b6d64297158b4e884c92d10f49f74c96069df722aa676839b72751ca9d1fe83a7025b591de00b` +- `9402c07923aa33bc911de80e61f388f5c4533e6b36e45317dc1db1e6bcc7664ed0c1c504d0ca8925208008961d95bbdbc36f6e3d91b3173369cc19ed625e9a0c` authorizer world: ``` @@ -2494,6 +2495,7 @@ World { "check if 1 | 2 ^ 3 === 0", "check if 2022-12-04T09:46:41Z !== 2020-12-04T09:46:41Z", "check if hex:12abcd !== hex:12ab", + "check if true !== false", "check if {1, 4} !== {1, 2}", ], }, diff --git a/biscuit-auth/samples/samples.json b/biscuit-auth/samples/samples.json index 62db50bf..3366eaf4 100644 --- a/biscuit-auth/samples/samples.json +++ b/biscuit-auth/samples/samples.json @@ -2251,7 +2251,7 @@ ], "public_keys": [], "external_key": null, - "code": "check if 1 !== 3;\ncheck if 1 | 2 ^ 3 === 0;\ncheck if \"abcD12x\" !== \"abcD12\";\ncheck if 2022-12-04T09:46:41Z !== 2020-12-04T09:46:41Z;\ncheck if hex:12abcd !== hex:12ab;\ncheck if {1, 4} !== {1, 2};\n", + "code": "check if true !== false;\ncheck if 1 !== 3;\ncheck if 1 | 2 ^ 3 === 0;\ncheck if \"abcD12x\" !== \"abcD12\";\ncheck if 2022-12-04T09:46:41Z !== 2020-12-04T09:46:41Z;\ncheck if hex:12abcd !== hex:12ab;\ncheck if {1, 4} !== {1, 2};\n", "version": 4 } ], @@ -2269,6 +2269,7 @@ "check if 1 | 2 ^ 3 === 0", "check if 2022-12-04T09:46:41Z !== 2020-12-04T09:46:41Z", "check if hex:12abcd !== hex:12ab", + "check if true !== false", "check if {1, 4} !== {1, 2}" ] } @@ -2282,7 +2283,7 @@ }, "authorizer_code": "allow if true;\n", "revocation_ids": [ - "117fa653744c859561555e6a6f5990e3a8e7817f91b87aa6991b6d64297158b4e884c92d10f49f74c96069df722aa676839b72751ca9d1fe83a7025b591de00b" + "9402c07923aa33bc911de80e61f388f5c4533e6b36e45317dc1db1e6bcc7664ed0c1c504d0ca8925208008961d95bbdbc36f6e3d91b3173369cc19ed625e9a0c" ] } } diff --git a/biscuit-auth/samples/test028_expressions_v4.bc b/biscuit-auth/samples/test028_expressions_v4.bc index c34d7a103fcfe7a1ada52e0be46ec70f544137e0..7d94e82d59e486fafc7c3a1fa354ad7020aaccb4 100644 GIT binary patch delta 102 zcmV-s0Ga=U1E2#268QoOjslSeAr3GB3IqxQFaQb!8UhFuu^9&eK$HT&c_XSbypbK~ z4q@|%^~6&?Yc}Ll7u+4O=Df#dPSC-{1klQfB_MzZmK~M5+rw{eJ(05)Gil5j?P6Y< I43l61ByU(H$N&HU delta 86 zcmV-c0IC0=1B3$x65Rp{@&Sf04L)rkNXU sWGQi2wCIG%EfDmdbje_8-*PIZc7vO8bsVYD{)49iTUj083zK{SBt9f2dH?_b