diff options
Diffstat (limited to 'rego-proofs/compiler-rewrite/test/compiler_rewrite.ml')
| -rw-r--r-- | rego-proofs/compiler-rewrite/test/compiler_rewrite.ml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/rego-proofs/compiler-rewrite/test/compiler_rewrite.ml b/rego-proofs/compiler-rewrite/test/compiler_rewrite.ml index ef42340..cbb7b04 100644 --- a/rego-proofs/compiler-rewrite/test/compiler_rewrite.ml +++ b/rego-proofs/compiler-rewrite/test/compiler_rewrite.ml @@ -24,7 +24,8 @@ q { x := 2 } |} in - let (_, bound) = To_test.extract_variables (extract_query policy_code) in + let open Compiler_rewrite.Compiler in + let { bound; _ } = To_test.extract_variables (extract_query policy_code) in Alcotest.(check strings) "expected identifier list" [ "x" ] bound @@ -38,7 +39,8 @@ q { z := 4 } |} in - let (_, bound) = To_test.extract_variables (extract_query policy_code) in + let open Compiler_rewrite.Compiler in + let { bound; _ } = To_test.extract_variables (extract_query policy_code) in Alcotest.(check strings) "expected identifier list" [ "x"; "y"; "z" ] bound @@ -51,7 +53,8 @@ q { y := x } |} in - let (_, bound) = To_test.extract_variables (extract_query policy_code) in + let open Compiler_rewrite.Compiler in + let { bound; _ } = To_test.extract_variables (extract_query policy_code) in Alcotest.(check strings) "expected identifier list" [ "x"; "y" ] bound @@ -64,7 +67,8 @@ q { y == 8 } |} in - let (free, bound) = To_test.extract_variables (extract_query policy_code) in + let open Compiler_rewrite.Compiler in + let { free; bound; _ } = To_test.extract_variables (extract_query policy_code) in Alcotest.(check strings) "expected identifier list" [] free; Alcotest.(check strings) @@ -79,7 +83,8 @@ q { z = 7 } |} in - let (free, bound) = To_test.extract_variables (extract_query policy_code) in + let open Compiler_rewrite.Compiler in + let { free; bound; _ } = To_test.extract_variables (extract_query policy_code) in Alcotest.(check strings) "expected identifier list" [ "z" ] free; Alcotest.(check strings) |