[clean up selftest
John Meacham <john@repetae.net>**20100714033613
 Ignore-this: ffd16809c82ba88ce3ad71e40f8c3a0e
] hunk ./selftest/SelfTest.hs 35
-    putStrLn "Testing Atom"
-    quickCheck prop_atomid
-    quickCheck prop_atomeq
-    quickCheck prop_atomIndex
-    quickCheck prop_atomneq
-    quickCheck prop_atomneq'
-    quickCheck $ label "atomint" prop_atomint
-    quickCheck $ label "atomii" prop_atomii
-    quickCheck prop_aappend
-
+    testAtom
hunk ./selftest/SelfTest.hs 37
-
hunk ./selftest/SelfTest.hs 43
-prop_atomid xs = fromAtom (toAtom xs) == (xs::String)
-prop_atomeq xs = (toAtom xs) == toAtom (xs::String)
-prop_atomneq xs ys = (xs /= ys) == (a1 /= a2) where
-    a1 = toAtom xs
-    a2 = toAtom (ys :: String)
-prop_atomIndex (xs :: String) = intToAtom (fromAtom a) == Just a where
-    a = toAtom xs
-prop_atomneq' xs ys = (xs `compare` ys) == (fromAtom a1 `compare` (fromAtom a2 :: BS.ByteString)) where
-    a1 = toAtom xs
-    a2 = toAtom (ys :: String)
-prop_atomint xs = an > 0 && odd an where
-    an = fromAtom $ toAtom (xs :: String) :: Int
-
-prop_atomii xs = Just xs == fromAtom `fmap` (intToAtom an) where
-    an = fromAtom $ toAtom (xs :: String) :: Int
+qc s p = quickCheck $ label s p
hunk ./selftest/SelfTest.hs 45
-prop_aappend (xs,ys) = (toAtom xs `mappend` toAtom ys) == toAtom ((xs::String) ++ ys)
-prop_aappend' (xs,ys) = fromAtom (toAtom xs `mappend` toAtom ys) == ((xs::String) ++ ys)
+testAtom = do
+    let prop_atomneq xs ys = (xs /= ys) == (a1 /= a2) where
+            a1 = toAtom xs
+            a2 = toAtom (ys :: String)
+        prop_atomIndex (xs :: String) = intToAtom (fromAtom a) == Just a where
+            a = toAtom xs
+        prop_atomneq' xs ys = (xs `compare` ys) == (fromAtom a1 `compare` (fromAtom a2 :: BS.ByteString)) where
+            a1 = toAtom xs
+            a2 = toAtom (ys :: String)
+        prop_atomint xs = an > 0 && odd an where
+            an = fromAtom $ toAtom (xs :: String) :: Int
+        prop_atomii xs = Just xs == fromAtom `fmap` (intToAtom an) where
+            an = fromAtom $ toAtom (xs :: String) :: Int
+        prop_aappend (xs,ys) = (toAtom xs `mappend` toAtom ys) == toAtom ((xs::String) ++ ys)
+        prop_aappend' (xs,ys) = fromAtom (toAtom xs `mappend` toAtom ys) == ((xs::String) ++ ys)
+    qc "atom.id" $ \xs -> fromAtom (toAtom xs) == (xs::String)
+    qc "atom.eq" $ \xs -> (toAtom xs) == toAtom (xs::String)
+    qc "atom.index" prop_atomIndex
+    qc "atom.neq" prop_atomneq
+    qc "atom.eq'" prop_atomneq'
+    qc "atom.int" prop_atomint
+    qc "atom.ii" prop_atomii
+    qc "atom.aapend" prop_aappend
hunk ./selftest/SelfTest.hs 102
-        qc s p = quickCheck $ label s p
hunk ./selftest/SelfTest.hs 116
-    putStrLn "Testing Properties"
hunk ./selftest/SelfTest.hs 120
-    quickCheck $ label "prop_list"  prop_list
-    quickCheck $ label "prop_enum"  prop_enum
-
-
+    qc "prop.list" prop_list
+    qc "prop.enum" prop_enum
hunk ./selftest/SelfTest.hs 124
-    putStrLn "Testing HasSize"
hunk ./selftest/SelfTest.hs 127
-    quickCheck prop_gt
-    quickCheck prop_gte
-    quickCheck prop_lte
+    qc "hasSize.gt" prop_gt
+    qc "hasSize.gte" prop_gte
+    qc "hasSize.lte" prop_lte
hunk ./selftest/SelfTest.hs 154
-
hunk ./selftest/SelfTest.hs 176
-
-
-
-
-