mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Arity for builtins (#28)
Old-style function call Utility for running opa yaml tests Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
951bb6b14c
commit
800e594d52
@@ -32,7 +32,7 @@ fn basic_array() -> Result<()> {
|
||||
array_compr_7 = [ 1 | [1, 2, 3][_]; [1, 2][_] >= 2 ]
|
||||
"#;
|
||||
|
||||
let expected = vec![Value::from_json_str(
|
||||
let expected = [Value::from_json_str(
|
||||
r#" {
|
||||
"array": [1, 2, 3],
|
||||
"array_compr_0": [1],
|
||||
@@ -46,11 +46,10 @@ fn basic_array() -> Result<()> {
|
||||
}"#,
|
||||
)?];
|
||||
|
||||
assert_match(
|
||||
eval_file(&[rego.to_owned()], None, None, "data.test", false)?,
|
||||
expected,
|
||||
);
|
||||
Ok(())
|
||||
check_output(
|
||||
&eval_file(&[rego.to_owned()], None, None, "data.test", false)?,
|
||||
&expected,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -81,7 +80,7 @@ fn basic_set() -> Result<()> {
|
||||
set_compr_7 = { a | a = [1, 2, 3][_]; [1, 2][_] >= 2 }
|
||||
"#;
|
||||
|
||||
let expected = vec![Value::from_json_str(
|
||||
let expected = [Value::from_json_str(
|
||||
r#" {
|
||||
"set": {
|
||||
"set!": [1, "string", [2, 3, 4], 567, false]
|
||||
@@ -115,9 +114,8 @@ fn basic_set() -> Result<()> {
|
||||
}"#,
|
||||
)?];
|
||||
|
||||
assert_match(
|
||||
eval_file(&[rego.to_owned()], None, None, "data.test", false)?,
|
||||
expected,
|
||||
);
|
||||
Ok(())
|
||||
check_output(
|
||||
&eval_file(&[rego.to_owned()], None, None, "data.test", false)?,
|
||||
&expected,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user