Skip to content

Commit

Permalink
test: check null.type() result
Browse files Browse the repository at this point in the history
  • Loading branch information
divarvel committed Jun 8, 2024
1 parent 7b075af commit 1214892
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions biscuit-auth/examples/testcases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,7 @@ fn typeof_op(target: &str, root: &KeyPair, test: bool) -> TestResult {
check if [true, false].type() == "set";
set([true, false]);
check if set($t), $t.type() == "set";
check if null.type() == "null";
null(null);
check if null($t), $t.type() == "null";
"#
Expand Down
4 changes: 3 additions & 1 deletion biscuit-auth/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2897,6 +2897,7 @@ check if true.type() == "bool";
check if bool($t), $t.type() == "bool";
check if [false, true].type() == "set";
check if set($t), $t.type() == "set";
check if null.type() == "null";
check if null($t), $t.type() == "null";
```

Expand All @@ -2908,7 +2909,7 @@ allow if true;
```

revocation ids:
- `388798e8ccb432572e6eb3dc8d0ca0501245597a44a605209f6f7571cae39f21a55edad33b55c4ec660be18f2141b75e7aabbfc0c7ff6461f12e80e1dc7b4d0a`
- `1d9153b1a5fd0a5ac4ba0c8c524850c9b94833574643bcfdb072de7a67a759c4bd92ef83710f22775a791409340468f3be00d882f43d837a2aafb10f376a440b`

authorizer world:
```
Expand Down Expand Up @@ -2948,6 +2949,7 @@ World {
"check if hex:aa.type() == \"bytes\"",
"check if integer($t), $t.type() == \"integer\"",
"check if null($t), $t.type() == \"null\"",
"check if null.type() == \"null\"",
"check if set($t), $t.type() == \"set\"",
"check if string($t), $t.type() == \"string\"",
"check if true.type() == \"bool\"",
Expand Down
5 changes: 3 additions & 2 deletions biscuit-auth/samples/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@
],
"public_keys": [],
"external_key": null,
"code": "integer(1);\nstring(\"test\");\ndate(2023-12-28T00:00:00Z);\nbytes(hex:aa);\nbool(true);\nset([false, true]);\nnull(null);\ncheck if 1.type() == \"integer\";\ncheck if integer($t), $t.type() == \"integer\";\ncheck if \"test\".type() == \"string\";\ncheck if string($t), $t.type() == \"string\";\ncheck if (2023-12-28T00:00:00Z).type() == \"date\";\ncheck if date($t), $t.type() == \"date\";\ncheck if hex:aa.type() == \"bytes\";\ncheck if bytes($t), $t.type() == \"bytes\";\ncheck if true.type() == \"bool\";\ncheck if bool($t), $t.type() == \"bool\";\ncheck if [false, true].type() == \"set\";\ncheck if set($t), $t.type() == \"set\";\ncheck if null($t), $t.type() == \"null\";\n"
"code": "integer(1);\nstring(\"test\");\ndate(2023-12-28T00:00:00Z);\nbytes(hex:aa);\nbool(true);\nset([false, true]);\nnull(null);\ncheck if 1.type() == \"integer\";\ncheck if integer($t), $t.type() == \"integer\";\ncheck if \"test\".type() == \"string\";\ncheck if string($t), $t.type() == \"string\";\ncheck if (2023-12-28T00:00:00Z).type() == \"date\";\ncheck if date($t), $t.type() == \"date\";\ncheck if hex:aa.type() == \"bytes\";\ncheck if bytes($t), $t.type() == \"bytes\";\ncheck if true.type() == \"bool\";\ncheck if bool($t), $t.type() == \"bool\";\ncheck if [false, true].type() == \"set\";\ncheck if set($t), $t.type() == \"set\";\ncheck if null.type() == \"null\";\ncheck if null($t), $t.type() == \"null\";\n"
}
],
"validations": {
Expand Down Expand Up @@ -2745,6 +2745,7 @@
"check if hex:aa.type() == \"bytes\"",
"check if integer($t), $t.type() == \"integer\"",
"check if null($t), $t.type() == \"null\"",
"check if null.type() == \"null\"",
"check if set($t), $t.type() == \"set\"",
"check if string($t), $t.type() == \"string\"",
"check if true.type() == \"bool\""
Expand All @@ -2760,7 +2761,7 @@
},
"authorizer_code": "allow if true;\n",
"revocation_ids": [
"388798e8ccb432572e6eb3dc8d0ca0501245597a44a605209f6f7571cae39f21a55edad33b55c4ec660be18f2141b75e7aabbfc0c7ff6461f12e80e1dc7b4d0a"
"1d9153b1a5fd0a5ac4ba0c8c524850c9b94833574643bcfdb072de7a67a759c4bd92ef83710f22775a791409340468f3be00d882f43d837a2aafb10f376a440b"
]
}
}
Expand Down
Binary file modified biscuit-auth/samples/test033_typeof.bc
Binary file not shown.

0 comments on commit 1214892

Please sign in to comment.