AoC 2024 - Day 1

This commit is contained in:
LunarAkai 2024-12-01 13:21:22 +01:00
commit 6079ff8c0d
6 changed files with 136 additions and 0 deletions

22
tests/day_one.rs Normal file
View file

@ -0,0 +1,22 @@
use advent_of_code_2024::day_1::*;
#[test]
fn test_d1_total_diff() {
assert_eq!(historian_hysteria_part_one("src/day_1/test_data.txt"), 11);
}
#[test]
fn test_d1_sets() {
let a: Vec<u32> = vec![1, 2, 3, 3, 3, 4];
assert_eq!(return_sets("src/day_1/test_data.txt").0, a);
let b: Vec<u32> = vec![3, 3, 3, 4, 5, 9];
assert_eq!(return_sets("src/day_1/test_data.txt").1, b);
}
#[test]
fn test_d1_total_sim_score() {
assert_eq!(historian_hysteria_part_two("src/day_1/test_data.txt"), 31);
}