Allow with modifier for builtin and user functions (#42)

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2023-11-12 21:39:59 -08:00
committed by GitHub
parent 1c492144b3
commit a1d0f8576a
9 changed files with 216 additions and 78 deletions
@@ -39,7 +39,7 @@ cases:
package test
x = array.reverse()
query: data.test
error: "at least one argument required for function calls"
error: "expects 1 argument"
- note: reverse-more-args
data: {}
+7 -3
View File
@@ -72,7 +72,7 @@ fn run_opa_tests() -> Result<()> {
return Ok(());
}
};
dbg!(&opa_tests_dir);
let tests_path = Path::new(&opa_tests_dir);
let mut status = BTreeMap::<String, (u32, u32)>::new();
let mut n = 0;
@@ -152,14 +152,18 @@ fn run_opa_tests() -> Result<()> {
}
println!("TESTSUITE STATUS");
println!(" {:30} {:4} {:4}", "FOLDER", "PASS", "FAIL");
println!(" {:40} {:4} {:4}", "FOLDER", "PASS", "FAIL");
let (mut npass, mut nfail) = (0, 0);
for (dir, (pass, fail)) in status {
if fail == 0 {
println!("\x1b[32m {dir:40}: {pass:4} {fail:4}\x1b[0m");
} else {
println!("\x1b[31m {dir:40}: {pass:4} {fail:4}\x1b[0m");
}
npass += pass;
nfail += fail;
}
println!();
println!("\x1b[31m {:40}: {npass:4} {nfail:4}\x1b[0m", "TOTAL");
Ok(())
}