+
+
+test_ord_instance1 :: TestTree
+test_ord_instance1 =
+ testCase desc $ actual @?= expected
+ where
+ desc = "127.0.0.0 is less than 127.0.0.1"
+ addr1 = mk_testaddr 127 0 0 0
+ addr2 = mk_testaddr 127 0 0 1
+ expected = True
+ actual = addr1 <= addr2
+
+
+test_ord_instance2 :: TestTree
+test_ord_instance2 =
+ testCase desc $ actual @?= expected
+ where
+ desc = "127.0.0.0 is less than 127.0.1.0"
+ addr1 = mk_testaddr 127 0 0 0
+ addr2 = mk_testaddr 127 0 1 0
+ expected = True
+ actual = addr1 <= addr2
+
+test_ord_instance3 :: TestTree
+test_ord_instance3 =
+ testCase desc $ actual @?= expected
+ where
+ desc = "127.0.0.0 is less than 127.1.0.0"
+ addr1 = mk_testaddr 127 0 0 0
+ addr2 = mk_testaddr 127 1 0 0
+ expected = True
+ actual = addr1 <= addr2
+
+test_ord_instance4 :: TestTree
+test_ord_instance4 =
+ testCase desc $ actual @?= expected
+ where
+ desc = "127.0.0.0 is less than 128.0.0.0"
+ addr1 = mk_testaddr 127 0 0 0
+ addr2 = mk_testaddr 128 0 0 0
+ expected = True
+ actual = addr1 <= addr2