+-- | Ensure that the Ord instance for Octets agrees with the Ord
+-- instance for Int (i.e. that numerical comparisons work).
+prop_ord_instances_agree :: TestTree
+prop_ord_instances_agree =
+ testProperty "the Octet and Int Ord instances agree" prop
+ where
+ prop :: Int -> Int -> Property
+ prop x y = (0 <= x) && (x <= 255) && (0 <= y) && (y <= 255) ==> ord == ord'
+ where
+ ord = (x <= y)
+
+ oct1 = toEnum x :: Octet
+ oct2 = toEnum y :: Octet
+ ord' = (oct1 <= oct2)