diff --git a/Cabal/Distribution/PackageDescription/Quirks.hs b/Cabal/Distribution/PackageDescription/Quirks.hs index a546c190de1..843ec853c49 100644 --- a/Cabal/Distribution/PackageDescription/Quirks.hs +++ b/Cabal/Distribution/PackageDescription/Quirks.hs @@ -250,7 +250,11 @@ patches = Map.fromList (Fingerprint 12475837388692175691 18053834261188158945) (Fingerprint 16279938253437334942 15753349540193002309) (bsReplace "9223372036854775807" "999") - + -- Not UTF8 + , mk "Name: nat\nVersion: 0.1\nDescription: Implementation of natural numbers and integers by a binary\n representation. The implementation is supposed to be lazy and\n " + (Fingerprint 9222512268705577108 13085311382746579495) + (Fingerprint 17468921266614378430 13221316288008291892) + (bsReplace "\xf6" "\xc3\xb6") ] where mk a b c d = ((a, b), (c, d)) diff --git a/Cabal/tests/HackageTests.hs b/Cabal/tests/HackageTests.hs index aae8beb0eec..3c24527ce89 100644 --- a/Cabal/tests/HackageTests.hs +++ b/Cabal/tests/HackageTests.hs @@ -48,7 +48,7 @@ import Data.Monoid (Sum (..)) import Distribution.PackageDescription.Check (PackageCheck (..), checkPackage) import Distribution.PackageDescription.PrettyPrint (showGenericPackageDescription) import Distribution.PackageDescription.Quirks (patchQuirks) -import Distribution.Simple.Utils (fromUTF8BS, toUTF8BS) +import Distribution.Simple.Utils (fromUTF8BS, toUTF8BS, fromUTF8BS) import System.Directory (getAppUserDataDirectory) import System.Environment (lookupEnv) import System.Exit (exitFailure) @@ -238,9 +238,9 @@ roundtripTest testFieldsTransform fpath bs = do -- fromParsecField, "shallow" parser/pretty roundtrip when testFieldsTransform $ - if checkUTF8 bs + if checkUTF8 patchedBs then do - parsecFields <- assertRight $ Parsec.readFields $ snd $ patchQuirks bs + parsecFields <- assertRight $ Parsec.readFields patchedBs let prettyFields = PP.fromParsecFields parsecFields let bs'' = PP.showFields (return []) prettyFields z0 <- parse "3rd" (toUTF8BS bs'') @@ -252,6 +252,8 @@ roundtripTest testFieldsTransform fpath bs = do return (Sum 1) where + patchedBs = snd (patchQuirks bs) + checkUTF8 bs' = replacementChar `notElem` fromUTF8BS bs' where replacementChar = '\xfffd' @@ -265,6 +267,7 @@ roundtripTest testFieldsTransform fpath bs = do assertEqual' bs' x y = unless (x == y || fpath == "ixset/1.0.4/ixset.cabal") $ do putStrLn fpath #ifdef MIN_VERSION_tree_diff + putStrLn "====== tree-diff:" print $ ansiWlEditExprCompact $ ediff x y #else putStrLn "<<<<<<" @@ -273,6 +276,7 @@ roundtripTest testFieldsTransform fpath bs = do print y putStrLn ">>>>>>" #endif + putStrLn "====== contents:" putStrLn bs' exitFailure