-
-
Save k-bx/f7feb6222a2febe62b7c to your computer and use it in GitHub Desktop.
strange errors in haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tests/EntitiesTest.hs:16:9: | |
No instance for (Yesod.Core.Handler.RedirectUrl | |
site0 (yesod-routes-1.2.0.1:Yesod.Routes.Class.Route App)) | |
arising from a use of `get' | |
Possible fix: | |
add an instance declaration for | |
(Yesod.Core.Handler.RedirectUrl | |
site0 (yesod-routes-1.2.0.1:Yesod.Routes.Class.Route App)) | |
In a stmt of a 'do' block: get EntriesR | |
In the second argument of `($)', namely | |
`do { get EntriesR; | |
statusIs 200; | |
maybeResponse <- getResponse; | |
let response = fromJust maybeResponse; | |
.... }' | |
In a stmt of a 'do' block: | |
yit "gets empty list of entries" | |
$ do { get EntriesR; | |
statusIs 200; | |
maybeResponse <- getResponse; | |
let response = fromJust maybeResponse; | |
.... } | |
tests/EntitiesTest.hs:22:53: | |
Couldn't match expected type `Maybe [EntryPresentation]' | |
with actual type `[a0]' | |
In the third argument of `assertEqual', namely `[]' | |
In a stmt of a 'do' block: | |
assertEqual "decoded list is empty" decoded [] | |
In the second argument of `($)', namely | |
`do { get EntriesR; | |
statusIs 200; | |
maybeResponse <- getResponse; | |
let response = fromJust maybeResponse; | |
.... }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entitiesSpecs :: Spec | |
entitiesSpecs = | |
ydescribe "/entries/ API tests" $ do | |
yit "gets empty list of entries" $ do | |
get EntriesR | |
statusIs 200 | |
maybeResponse <- getResponse | |
let response = fromJust maybeResponse | |
let body = simpleBody response | |
let decoded = decode body :: Maybe [EntryPresentation] | |
assertEqual "decoded list is empty" (fromJust decoded) [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment