summaryrefslogtreecommitdiff
path: root/2024/OCaml/test/day_01_part_01.ml
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2025-11-29 20:23:02 +0100
committerDJ O'Leary <dijitol@proton.me>2025-11-29 20:23:02 +0100
commit4c3a50166bf0f78ce89459c352cc1c6536a8b96d (patch)
tree02e4b66a1435680ef1e92bf82576747b27f16447 /2024/OCaml/test/day_01_part_01.ml
parentbe2f8528b3829f8263507da301812d852297c168 (diff)
chore: make language folders snake_case
Diffstat (limited to '2024/OCaml/test/day_01_part_01.ml')
-rw-r--r--2024/OCaml/test/day_01_part_01.ml27
1 files changed, 0 insertions, 27 deletions
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