
On Tue, 2002-09-03 at 10:46, Martin Norbäck wrote:
My quickCheck tests found errors in three and four byte encodings:
*Text.Encoding.TestUTF8> encodeOne (toEnum 51177) [236,159,140] *Text.Encoding.TestUTF8> decodeOne [236,159,140] (Right '\51148',3,[]) *Text.Encoding.TestUTF8> encodeOne (toEnum 845466) [243,206,154,154] *Text.Encoding.TestUTF8> decodeOne [243,206,154,154] (Left (InvalidLaterByte 1),1,[206,154,154])
51177 should encode into [236,159,169] 845466 should encode into [243,142,154,154]
Fixed. All three properties seem to be satisfied in GHCi now. Beware of prop_DecEnc, though, quickCheck erroneously claims to falsify it. I guess this is caused by a bug in GHC 5.04's handling of strings that hit the list some time ago (try "\666"==['\666']). Manually applying prop_DecEnc to the alleged counter example has always yielded True for me. Regards, Sven Moritz