aboutsummaryrefslogtreecommitdiff
path: root/tests/importCSV_test.ml
blob: fc6d54599cb4529215b71964c6ea3e7d476a2520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
open ImportCSV
open Test_migration

let assert_equal = Alcotest.(check int "")

let test_suit =
  [
    ("Column A" >:: fun _ -> assert_equal 1 (Csv.column_of_string "A"));
    ("Column a" >:: fun _ -> assert_equal 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 i column_index
        done
      in
      () );
  ]

let tests = "importCSV_test" >::: test_suit