| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Test.HTTP
- httpTestCase :: String -> Url -> Session () -> TestTree
- get :: Url -> Session String
- getJSON :: FromJSON a => Url -> Session a
- withJSON :: FromJSON a => String -> (a -> Session ()) -> Session ()
- post :: Url -> String -> Session String
- postJSON :: (ToJSON a, FromJSON b) => Url -> a -> Session b
- postForm :: Url -> [(String, String)] -> Session String
- assert :: String -> Bool -> Session ()
- assertEq :: (Show a, Eq a) => String -> a -> a -> Session ()
- assertParse :: String -> Parser Bool -> Session ()
- debug :: String -> Session ()
- type Session = StateT HttpTest IO
- type Url = String
- defaultMain :: TestTree -> IO ()
- tic :: Session ()
- toc :: String -> Session Double
Documentation
Arguments
| :: FromJSON a | |
| => String | URL |
| -> (a -> Session ()) | action to perform on successfully decoded value |
| -> Session () |
perform an action with a JSON value from a GET
Arguments
| :: String | assertion name (used for reporting failures |
| -> Bool | Boolean of which we are asserting truth |
| -> Session () |
make an assertion
Arguments
| :: (Show a, Eq a) | |
| => String | assertion name (used for reporting failures |
| -> a | a value |
| -> a | what it is meant to be equal to |
| -> Session () |
assert equality, for better output messages
Arguments
| :: String | assertion name (used for reporting failures |
| -> Parser Bool | Boolean of which we are asserting truth |
| -> Session () |
make an assertion in the Parser monad, for use with JSON value
debug :: String -> Session () Source
Output a string to stdout if --verbose is in command line arguments
defaultMain :: TestTree -> IO ()
Parse the command line arguments and run the tests