diff options
Diffstat (limited to 'tests/configuration_toml.ml')
-rw-r--r-- | tests/configuration_toml.ml | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/configuration_toml.ml b/tests/configuration_toml.ml index 470af4a..620a106 100644 --- a/tests/configuration_toml.ml +++ b/tests/configuration_toml.ml @@ -303,6 +303,40 @@ columns = []|} Alcotest.(check (result Test_migration.syntax string)) "Dataset with alias" expected configuration +let external_filters () = + let configuration = + ConfLoader.load' + {|[source] +name = "" +file = "" +tab = 0 + +[externals.other] + intern_key = ":A" + file = "other.xlsx" + extern_key = ":C" + filters = [":B = 1"] + + +[sheet] +columns = []|} + and expected = + Ok + { + ImporterSyntax.dummy_conf with + externals = + ConfLoader. + [ + { + external_other with + filters = [ Expression_builder.(equal (path 2) integer_one) ]; + }; + ]; + } + in + Alcotest.(check (result Test_migration.syntax string)) + "Filters in external" expected configuration + let test_suit = [ ( "parse_extern" >:: fun _ -> @@ -322,7 +356,7 @@ let test_suit = Path { alias = None; column = 1 }; Path { alias = None; column = 2 }; ] ); - match_rule = None; + filters = []; allow_missing = true; } in @@ -372,6 +406,7 @@ let test_suit = ("Empty dataset", `Quick, empty_dataset); ("Dataset with invalid key", `Quick, dataset_with_invalid_key); ("External dataset", `Quick, external_dataset); + ("External with filter", `Quick, external_filters); ] let tests = "configuration_toml" >::: test_suit |