From f01a9b15801bd6d9b53416ba87243cef7e9f596a Mon Sep 17 00:00:00 2001 From: Samuel Owen Date: Wed, 27 Dec 2023 20:25:51 +0000 Subject: [PATCH] Add test for summing values in a map --- test/day2/day2_test.exs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/day2/day2_test.exs b/test/day2/day2_test.exs index d638097..8adb510 100644 --- a/test/day2/day2_test.exs +++ b/test/day2/day2_test.exs @@ -41,4 +41,14 @@ defmodule Day2Test do test "it extracts integer from a string" do assert Day2.extract_integer("21 meow 21") == 2121 end + + test "it adds the values of a map together" do + map = %{ + :red => 7, + :green => 8, + :blue => 14 + } + + assert Day2.sum_map(map) == 29 + end end