Add more doctests

This commit is contained in:
Julian Ospald 2021-08-24 10:51:39 +02:00
parent f624a83e87
commit 8247c0b00b
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
1 changed files with 2 additions and 0 deletions

View File

@ -601,5 +601,7 @@ urlBaseName = snd . B.breakEnd (== _slash) . urlDecode False
--
-- >>> getLastHeader "\n\nHTTP/1.0 200 Connection established\n\nHTTP/1.1 304 Not Modified\n"
-- "HTTP/1.1 304 Not Modified\n"
-- >>> getLastHeader "HTTP/1.1 304 Not Modified\n"
-- "HTTP/1.1 304 Not Modified\n"
getLastHeader :: T.Text -> T.Text
getLastHeader = T.unlines . lastDef [] . filter (\x -> not (null x)) . splitOn [""] . fmap T.stripEnd . T.lines