yet another wibble on the tests
authoriavor.diatchki <iavor.diatchki@gmail.com>
Mon, 10 Mar 2008 04:18:33 +0000 (21:18 -0700)
committeriavor.diatchki <iavor.diatchki@gmail.com>
Mon, 10 Mar 2008 04:18:33 +0000 (21:18 -0700)
darcs-hash:20080310041833-5035a-4958290788d06281413e00081b255860f6648785.gz

tests/BenchBytestring.hs

index 6e372f2..48c669b 100644 (file)
@@ -26,14 +26,14 @@ main4 = do putStrLn "Correctness: Data.ByteString"
 
 encodeDecodeTest :: String
 encodeDecodeTest =
-     filter (\x -> expect x x) legal_codepoints
-  ++ filter (expect (UTF8.replacement_char)) illegal_codepoints
+     filter (\x -> enc x /= [x]) legal_codepoints
+  ++ filter (\x -> enc x /= [UTF8.replacement_char]) illegal_codepoints
   where
     legal_codepoints    = ['\0'..'\xd7ff'] ++ ['\xe000'..'\xfffd']
                        ++ ['\x10000'..'\x10ffff']
     illegal_codepoints  = '\xffff' : '\xfffe' : ['\xd800'..'\xdfff']
 
-    expect y x = UTF8.toString (UTF8.fromString [x] :: UTF8.UTF8 S.ByteString)
-                  /= [y]
+{-# INLINE enc #-}
+enc x = UTF8.toString (UTF8.fromString [x] :: UTF8.UTF8 S.ByteString)