Skip to content

Commit

Permalink
use strict equals in integer wraparound samples
Browse files Browse the repository at this point in the history
This makes this sample usable with older implementations
  • Loading branch information
divarvel committed Nov 20, 2024
1 parent 6bb3b34 commit e544df5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions biscuit-auth/examples/testcases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1936,9 +1936,9 @@ fn integer_wraparound(target: &str, root: &KeyPair, test: bool) -> TestResult {

let biscuit = biscuit!(
r#"
check if 10000000000 * 10000000000 != 0;
check if 9223372036854775807 + 1 != 0;
check if -9223372036854775808 - 1 != 0;
check if 10000000000 * 10000000000 !== 0;
check if 9223372036854775807 + 1 !== 0;
check if -9223372036854775808 - 1 !== 0;
"#
)
.build_with_rng(&root, SymbolTable::default(), &mut rng)
Expand Down
14 changes: 7 additions & 7 deletions biscuit-auth/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2257,9 +2257,9 @@ symbols: []
public keys: []

```
check if 10000000000 * 10000000000 != 0;
check if 9223372036854775807 + 1 != 0;
check if -9223372036854775808 - 1 != 0;
check if 10000000000 * 10000000000 !== 0;
check if 9223372036854775807 + 1 !== 0;
check if -9223372036854775808 - 1 !== 0;
```

### validation
Expand All @@ -2270,7 +2270,7 @@ allow if true;
```

revocation ids:
- `846fbe9e7ad3581eada5d33475fb6362e83a526c5d3c7c1c6c063e8dc512485f1ec9f876d9e83d6d335e79b35e7be38b728c1b3583a6d56dd85b104c2e4f4404`
- `fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c`

authorizer world:
```
Expand All @@ -2283,9 +2283,9 @@ World {
0,
),
checks: [
"check if -9223372036854775808 - 1 != 0",
"check if 10000000000 * 10000000000 != 0",
"check if 9223372036854775807 + 1 != 0",
"check if -9223372036854775808 - 1 !== 0",
"check if 10000000000 * 10000000000 !== 0",
"check if 9223372036854775807 + 1 !== 0",
],
},
]
Expand Down
10 changes: 5 additions & 5 deletions biscuit-auth/samples/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@
"symbols": [],
"public_keys": [],
"external_key": null,
"code": "check if 10000000000 * 10000000000 != 0;\ncheck if 9223372036854775807 + 1 != 0;\ncheck if -9223372036854775808 - 1 != 0;\n"
"code": "check if 10000000000 * 10000000000 !== 0;\ncheck if 9223372036854775807 + 1 !== 0;\ncheck if -9223372036854775808 - 1 !== 0;\n"
}
],
"validations": {
Expand All @@ -2115,9 +2115,9 @@
{
"origin": 0,
"checks": [
"check if -9223372036854775808 - 1 != 0",
"check if 10000000000 * 10000000000 != 0",
"check if 9223372036854775807 + 1 != 0"
"check if -9223372036854775808 - 1 !== 0",
"check if 10000000000 * 10000000000 !== 0",
"check if 9223372036854775807 + 1 !== 0"
]
}
],
Expand All @@ -2132,7 +2132,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"846fbe9e7ad3581eada5d33475fb6362e83a526c5d3c7c1c6c063e8dc512485f1ec9f876d9e83d6d335e79b35e7be38b728c1b3583a6d56dd85b104c2e4f4404"
"fb5e7ac2bb892f5cf2fb59677cfad1f96deabbc8e158e3fd1b5ee7c4b6949c999e2169187cbee53b943eebdadaaf68832747baa8cffa2ff9f78025a1f55f440c"
]
}
}
Expand Down
Binary file modified biscuit-auth/samples/test027_integer_wraparound.bc
Binary file not shown.

0 comments on commit e544df5

Please sign in to comment.