Skip to content

Commit

Permalink
test array parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Jun 8, 2024
1 parent 150d5db commit 0399b2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions biscuit-auth/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ fn block_macro() {
let mut term_set = BTreeSet::new();
term_set.insert(builder::int(0i64));
let my_key = "my_value";
let array_param = 2;
let mapkey = "hello";

let mut b = block!(
r#"fact("test", hex:aabbcc, [true], {my_key}, {term_set}, {"a": 1, 2 : "abcd", {mapkey}: 0 });
r#"fact("test", hex:aabbcc, [1, {array_param}], {my_key}, {term_set}, {"a": 1, 2 : "abcd", {mapkey}: 0 });
rule($0, true) <- fact($0, $1, $2, {my_key}), true || false;
check if {my_key}.starts_with("my");
check if {true,false}.any($p -> true);
Expand All @@ -25,7 +26,7 @@ fn block_macro() {

assert_eq!(
b.to_string(),
r#"fact("test", hex:aabbcc, [true], "my_value", {0}, {2: "abcd", "a": 1, "hello": 0});
r#"fact("test", hex:aabbcc, [1, 2], "my_value", {0}, {2: "abcd", "a": 1, "hello": 0});
appended(true);
rule($0, true) <- fact($0, $1, $2, "my_value"), true || false;
check if "my_value".starts_with("my");
Expand Down

0 comments on commit 0399b2f

Please sign in to comment.