Skip to content

Commit

Permalink
yet another wibble on the tests
Browse files Browse the repository at this point in the history
darcs-hash:20080310041833-5035a-4958290788d06281413e00081b255860f6648785.gz
  • Loading branch information
yav committed Mar 10, 2008
1 parent 325029a commit 6b80e55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/BenchBytestring.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)


0 comments on commit 6b80e55

Please sign in to comment.