Skip to content
This repository
Browse code

fix "front-page" example, following fix to module haddock

  • Loading branch information...
commit aec63b1652c0ae112d9e4b2c1e6682643dea76a3 1 parent 8a87593
Ganesh Sittampalam hsenag authored

Showing 2 changed files with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 HTTP.cabal
  2. +2 0  test/httpTests.hs
10 HTTP.cabal
@@ -34,12 +34,12 @@ Description:
34 34 > -- fetch document and return it (as a 'String'.)
35 35 > fmap (take 100) (getResponseBody rsp)
36 36 >
37   - > do
38   - > rsp <- Network.Browser.browse $ do
  37 + > do
  38 + > (_, rsp)
  39 + > <- Network.Browser.browse $ do
39 40 > setAllowRedirects True -- handle HTTP redirects
40   - > request $ getRequest "http://google.com/"
41   - > fmap (take 100) (getResponseBody rsp)
42   - >
  41 + > request $ getRequest "http://www.haskell.org/"
  42 + > return (take 100 (rspBody rsp))
43 43
44 44 Extra-Source-Files: CHANGES
45 45
2  test/httpTests.hs
@@ -38,6 +38,7 @@ basicExample :: Assertion
38 38 basicExample = do
39 39 result <-
40 40 -- sample code from Network.HTTP haddock, with URL changed
  41 + -- Note there's also a copy of the example in the .cabal file
41 42 simpleHTTP (getRequest (testUrl "/basic/example")) >>= fmap (take 100) . getResponseBody
42 43 assertEqual "Receiving expected response" (take 100 haskellOrgText) result
43 44
@@ -85,6 +86,7 @@ browserExample :: Assertion
85 86 browserExample = do
86 87 result <-
87 88 -- sample code from Network.Browser haddock, with URL changed
  89 + -- Note there's also a copy of the example in the .cabal file
88 90 do
89 91 (_, rsp)
90 92 <- Network.Browser.browse $ do

0 comments on commit aec63b1

Please sign in to comment.
Something went wrong with that request. Please try again.