diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2024-03-14 08:26:58 +0100 |
commit | 6b377719c10d5ab3343fd5221f99a4a21008e25a (patch) | |
tree | a7c1e9a820d339a2f161af3e09cf9e3161286796 /tests/importCSV_test.ml |
Initial commitmain
Diffstat (limited to 'tests/importCSV_test.ml')
-rw-r--r-- | tests/importCSV_test.ml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/importCSV_test.ml b/tests/importCSV_test.ml new file mode 100644 index 0000000..bc21992 --- /dev/null +++ b/tests/importCSV_test.ml @@ -0,0 +1,29 @@ +open OUnit2 +open ImportCSV + +let test_suit = + [ + ( "Column A" >:: fun _ -> + assert_equal + ~printer:(fun i -> Printf.sprintf "%d (%s)" i (Csv.column_to_string i)) + 1 (Csv.column_of_string "A") ); + ( "Column a" >:: fun _ -> + assert_equal + ~printer:(fun i -> Printf.sprintf "%d (%s)" i (Csv.column_to_string i)) + 1 (Csv.column_of_string "a") ); + ( "Column name" >:: fun _ -> + let () = + for i = 1 to 1_000 do + let column_name = Csv.column_to_string i in + let column_index = Csv.column_of_string column_name in + + assert_equal + ~printer:(fun i -> + Printf.sprintf "%d (%s)" i (Csv.column_to_string i)) + i column_index + done + in + () ); + ] + +let tests = "importCSV_test" >::: test_suit |