git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix psc-publish tests

For some reason, an explicit "module Main where" is required for these to work.

commitf0fa4b03b87b496a19acccfe8eb2670889b08a77 authorHarry Garrood <harry@garrood.me> dateMon 13 Jul 2015, 03:43 (11 years ago) parent2e6b3ee
2 files changed+5−3
psc-publish/Main.hs+2 psc-publish/tests/Test.hs+3−3
psc-publish/Main.hs+2
@@ -3,6 +3,8 @@
33{-# LANGUAGE TupleSections #-}
44{-# LANGUAGE GeneralizedNewtypeDeriving #-}
55
6+module Main where
7+
68import Prelude hiding (userError)
79
810import Data.Maybe
psc-publish/tests/Test.hs+3−3
@@ -57,7 +57,7 @@ getPackage = do
5757 pushd packageDir preparePackage
5858
5959data TestResult
60− = ParseFailed (ParseError PackageError)
60+ = ParseFailed String
6161 | Mismatch ByteString ByteString -- ^ encoding before, encoding after
6262 | Pass ByteString
6363 deriving (Show)
@@ -70,10 +70,10 @@ test = roundTrip <$> getPackage
7070roundTrip :: UploadedPackage -> TestResult
7171roundTrip pkg =
7272 let before = A.encode pkg
73− in case parse asUploadedPackage before of
73+ in case A.eitherDecode before of
7474 Left err -> ParseFailed err
7575 Right parsed -> do
76− let after = A.encode parsed
76+ let after = A.encode (parsed :: UploadedPackage)
7777 if before == after
7878 then Pass before
7979 else Mismatch before after