Tests running again

This commit is contained in:
Michael Snoyman 2010-06-09 09:50:30 +03:00
parent d57dc78983
commit f99852fd0f
2 changed files with 5 additions and 7 deletions

View File

@ -396,8 +396,7 @@ propEncDecSession session' = unsafePerformIO $ do
let expire = addUTCTime 1 now let expire = addUTCTime 1 now
let rhost = B.pack "some host" let rhost = B.pack "some host"
let val = encodeSession key expire rhost session' let val = encodeSession key expire rhost session'
return $ Just session' == return $ Just session' == decodeSession key now rhost val
decodeSession key now rhost (B.pack val)
propGetPutTime :: UTCTime -> Bool propGetPutTime :: UTCTime -> Bool
propGetPutTime t = Right t == runGet getTime (runPut $ putTime t) propGetPutTime t = Right t == runGet getTime (runPut $ putTime t)

View File

@ -30,7 +30,7 @@ import Text.Hamlet
import Test.Framework (testGroup, Test) import Test.Framework (testGroup, Test)
import Test.Framework.Providers.HUnit import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test) import Test.HUnit hiding (Test)
import Data.Text.Lazy (unpack) import Data.ByteString.Lazy.Char8 (unpack)
import Yesod.Content hiding (testSuite) import Yesod.Content hiding (testSuite)
#else #else
import Yesod.Content import Yesod.Content
@ -128,11 +128,10 @@ caseSimpleOutput = do
let j = do let j = do
jsonMap jsonMap
[ ("foo" , jsonList [ ("foo" , jsonList
[ jsonScalar $ Encoded $ pack "bar" [ jsonScalar $ preEscapedString "bar"
, jsonScalar $ Encoded $ pack "baz" , jsonScalar $ preEscapedString "baz"
]) ])
] ]
t <- hamletToText id $ unJson j "{\"foo\":[\"bar\",\"baz\"]}" @=? unpack (renderHtml $ unJson j)
"{\"foo\":[\"bar\",\"baz\"]}" @=? unpack t
#endif #endif