+test_combine_all1 :: Test
+test_combine_all1 =
+ TestCase $ assertEqual "10.0.0.0/24 is adjacent to 10.0.1.0/24 and 10.0.3.0/23 contains 10.0.2.0/24" expected_cidrs (combine_all test_cidrs)
+ where
+ cidr1 = cidr_from_string "10.0.0.0/24"
+ cidr2 = cidr_from_string "10.0.1.0/24"
+ cidr3 = cidr_from_string "10.0.2.0/24"
+ cidr4 = cidr_from_string "10.0.3.0/23"
+ cidr5 = cidr_from_string "10.0.0.0/23"
+ expected_cidrs = [cidr_from_string "10.0.0.0/22"]
+ test_cidrs = [cidr1, cidr2, cidr3, cidr4, cidr5]
+
+
+test_combine_all2 :: Test
+test_combine_all2 =
+ TestCase $ assertEqual "127.0.0.1/32 combines with itself recursively" expected_cidrs (combine_all test_cidrs)
+ where
+ cidr1 = cidr_from_string "127.0.0.1/32"
+ expected_cidrs = [cidr1]
+ test_cidrs = [cidr1, cidr1, cidr1, cidr1, cidr1]
+
+
+test_combine_all3 :: Test
+test_combine_all3 =
+ TestCase $ assertEqual "10.0.0.16, 10.0.0.17, 10.0.0.18, and 10.0.0.19 get combined into 10.0.0.16/30" expected_cidrs (combine_all test_cidrs)
+ where
+ cidr1 = cidr_from_string "10.0.0.16/32"
+ cidr2 = cidr_from_string "10.0.0.17/32"
+ cidr3 = cidr_from_string "10.0.0.18/32"
+ cidr4 = cidr_from_string "10.0.0.19/32"
+ expected_cidrs = [cidr_from_string "10.0.0.16/30"]
+ test_cidrs = [cidr1, cidr2, cidr3, cidr4]
+
+