]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Maskbits.hs
Switch from test-framework to tasty.
[hath.git] / src / Maskbits.hs
index 51701f562276ece9cc216a0d9cb649624ff7fe1c..27fa29fa2934e146f1d6ba848453bfacd0c7bfc7 100644 (file)
@@ -1,9 +1,8 @@
 module Maskbits(
-  Maskbits(..),
-  )
+  Maskbits(..) )
 where
 
-import Test.QuickCheck (Arbitrary(..), elements)
+import Test.Tasty.QuickCheck ( Arbitrary(..), elements )
 
 
 -- | A type representing the number of bits in a CIDR netmask.
@@ -118,12 +117,12 @@ instance Arbitrary Maskbits where
 
 
 instance Read Maskbits where
-  readsPrec _ = \s ->
+  readsPrec _ s =
     case (reads s :: [(Int, String)]) of
       []              -> []
       (x,leftover):_  -> go x leftover
     where
       go :: Int -> String -> [(Maskbits, String)]
-      go y s
-        | y < minBound || y > maxBound = []
-        | otherwise = [(toEnum y, s)]
+      go x' leftover'
+        | x' < minBound || x' > maxBound = []
+        | otherwise = [(toEnum x', leftover')]