From bc8b9edc0860f4804dfd0ea868ee7beaa564e62a Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Sat, 27 Jun 2026 04:28:48 +0200 Subject: test: fix ocaml tests 2024 {WIP} --- 2024/ocaml/test/day_01_part_01.ml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 2024/ocaml/test/day_01_part_01.ml (limited to '2024/ocaml/test/day_01_part_01.ml') diff --git a/2024/ocaml/test/day_01_part_01.ml b/2024/ocaml/test/day_01_part_01.ml deleted file mode 100644 index 824c95b..0000000 --- a/2024/ocaml/test/day_01_part_01.ml +++ /dev/null @@ -1,27 +0,0 @@ -open OUnit2 -open AoC_2024.Day_01.Part_01 - -let tests = - "test suite for day 01 part 01" - >::: [ - ("empty list is 0" >:: fun _ -> assert_equal 0 (solve [] [])); - ( "distance between 0 and 1 is 1" >:: fun _ -> - assert_equal 1 (solve [ 0 ] [ 1 ]) ); - ( "distance between 1 and 0 is 1" >:: fun _ -> - assert_equal 1 (solve [ 1 ] [ 0 ]) ); - ( "smallest are paired, then next smallest, ..." >:: fun _ -> - assert_equal 0 (solve [ 1; 2; 3 ] [ 3; 2; 1 ]) ); - (* See https://adventofcode.com/2024/day/1 *) - ( "solves example correctly" >:: fun _ -> - assert_equal 11 (solve [ 3; 4; 2; 1; 3; 3 ] [ 4; 3; 5; 3; 9; 3 ]) ); - ( "same number is 0 distance apart" >:: fun _ -> - assert_equal 0 (calculate_distance 0 0) ); - ( "same number is 0 distance apart" >:: fun _ -> - assert_equal 0 (calculate_distance 1 1) ); - ( "distance is equal to abs(x - y)" >:: fun _ -> - assert_equal 1 (calculate_distance 0 1) ); - ( "order of inputs doesn't matter" >:: fun _ -> - assert_equal 1 (calculate_distance 1 0) ); - ] - -let _ = run_test_tt_main tests -- cgit v1.2.3