diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2024-12-11 22:04:40 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2024-12-12 14:19:48 +0100 |
commit | 39f39919fb4749787393e95503f9814912265a73 (patch) | |
tree | 57745ab257e50f9ef4d6924c3c77d51fd8fb4d4d /tests | |
parent | 5a558038874765f20b9dc1bcb1890600e2a2065d (diff) |
Review the consistency request
Diffstat (limited to 'tests')
-rw-r--r-- | tests/analyser_query_test.ml | 20 | ||||
-rw-r--r-- | tests/confLoader.ml | 8 | ||||
-rw-r--r-- | tests/configuration_toml.ml | 28 |
3 files changed, 28 insertions, 28 deletions
diff --git a/tests/analyser_query_test.ml b/tests/analyser_query_test.ml index 3559de4..8f531ce 100644 --- a/tests/analyser_query_test.ml +++ b/tests/analyser_query_test.ml @@ -85,10 +85,10 @@ let check_externals = let expected_query = "SELECT 'source'.'id', 'source'.col_1 FROM\n\ - 'source' AS 'source' LEFT JOIN 'other' AS 'other' ON \ - rtrim(upper('source'.col_1)) = 'other'.'key_other' WHERE \ - 'other'.'key_other' IS NULL AND 'source'.col_1 IS NOT NULL AND \ - 'source'.col_1 <> ''" + 'source' AS 'source'\n\ + LEFT JOIN 'other' AS 'other' ON rtrim(upper('source'.col_1)) = \ + 'other'.'key_other' WHERE 'other'.'key_other' IS NULL AND 'source'.col_1 \ + IS NOT NULL AND 'source'.col_1 <> ''" in assert_equal ~printer:Fun.id expected_query query.q @@ -222,10 +222,10 @@ let prepare_insert = assert_equal ~printer:Fun.id expected contents -(** Test a request with a group in a filter. +(** Test a request with a group in a filter. -This generate a CTE expression in order to evaluate the group before loading -the results from the query. *) + This generate a CTE expression in order to evaluate the group before loading + the results from the query. *) let filter_group = "Test filter_group" >:: fun _ -> let c col = Expr.path ImportDataTypes.Path.{ alias = None; column = col } in @@ -253,10 +253,10 @@ WHERE (cte.group0)|} assert_equal ~printer:(fun s -> Printf.sprintf "\n%s" s) expected contents.q -(** Test a request with a group in a filter. +(** Test a request with a group in a filter. -This generate a CTE expression in order to evaluate the group before loading -the results from the query. *) + This generate a CTE expression in order to evaluate the group before loading + the results from the query. *) let filter_group2 = "Test filter_group" >:: fun _ -> let c col = Expr.path ImportDataTypes.Path.{ alias = None; column = col } in diff --git a/tests/confLoader.ml b/tests/confLoader.ml index 266ff33..bce4db0 100644 --- a/tests/confLoader.ml +++ b/tests/confLoader.ml @@ -39,7 +39,7 @@ let external_table_other = ImportDataTypes.Table.{ file = "other.xlsx"; tab = 1; name = "other" } let external_other = - ImportConf.Syntax. + ImportConf.Syntax.Extern. { intern_key = Path { alias = None; column = 1 }; target = external_table_other; @@ -52,7 +52,7 @@ let external_table_last = ImportDataTypes.Table.{ file = "last.xlsx"; tab = 1; name = "last_file" } let external_last = - ImportConf.Syntax. + ImportConf.Syntax.Extern. { intern_key = Path { alias = Some "other"; column = 1 }; target = external_table_last; @@ -124,5 +124,5 @@ let keys_printer : ImportAnalyser.Dependency.key list -> string = * Represents externals *) -let pp_externals : ImportConf.Syntax.extern list -> string = - fun ext -> ImportConf.Syntax.toml_of_externs ext |> Otoml.Printer.to_string +let pp_externals : ImportConf.Syntax.Extern.t list -> string = + fun ext -> ImportConf.Syntax.Extern.toml ext |> Otoml.Printer.to_string diff --git a/tests/configuration_toml.ml b/tests/configuration_toml.ml index 3c8bfc2..e58ff1b 100644 --- a/tests/configuration_toml.ml +++ b/tests/configuration_toml.ml @@ -10,21 +10,21 @@ let test_suit = match toml with | Error s -> raise (Failure s) | Ok result -> - let open ImportConf.Syntax in let expected = - { - target = { file = ""; tab = 1; name = "target" }; - extern_key = Literal "_B"; - intern_key = - Function - ( "function", - [ - Path { alias = None; column = 1 }; - Path { alias = None; column = 2 }; - ] ); - match_rule = None; - allow_missing = true; - } + ImportConf.Syntax.Extern. + { + target = { file = ""; tab = 1; name = "target" }; + extern_key = Literal "_B"; + intern_key = + Function + ( "function", + [ + Path { alias = None; column = 1 }; + Path { alias = None; column = 2 }; + ] ); + match_rule = None; + allow_missing = true; + } in let printer s = |