uri-bytestring 0.1.3 → 0.1.4
raw patch · 4 files changed
+21/−4 lines, 4 filesdep ~blaze-builderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: blaze-builder
API changes (from Hackage documentation)
Files
- changelog.md +3/−1
- src/URI/ByteString/Internal.hs +2/−2
- test/URI/ByteStringTests.hs +14/−0
- uri-bytestring.cabal +2/−1
changelog.md view
@@ -1,6 +1,8 @@+0.1.4+* Bump attoparsec bounds+ 0.1.3 * Include test modules in distribution- 0.1.2 * Add support for GHC 7.10
src/URI/ByteString/Internal.hs view
@@ -58,7 +58,7 @@ -- >>> BB.toLazyByteString $ serializeURI $ URI {uriScheme = Scheme {schemeBS = "http"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "www.example.org"}, authorityPort = Nothing}), uriPath = "/foo", uriQuery = Query {queryPairs = [("bar","baz")]}, uriFragment = Just "quux"} -- "http://www.example.org/foo?bar=baz#quux" serializeURI :: URI -> Builder-serializeURI URI {..} = scheme <> BB.fromString "://" <>+serializeURI URI {..} = scheme <> BB.fromString ":" <> serializeRelativeRef rr where scheme = bs $ schemeBS uriScheme@@ -86,7 +86,7 @@ ------------------------------------------------------------------------------- serializeAuthority :: Authority -> Builder-serializeAuthority Authority {..} = userinfo <> bs host <> port+serializeAuthority Authority {..} = BB.fromString "//" <> userinfo <> bs host <> port where userinfo = maybe mempty serializeUserInfo authorityUserInfo host = hostBS authorityHost
test/URI/ByteStringTests.hs view
@@ -4,6 +4,7 @@ ------------------------------------------------------------------------------- import Control.Lens+import qualified Blaze.ByteString.Builder as BB import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B8 import Data.Monoid@@ -109,6 +110,13 @@ (Query []) Nothing + , roundtripTestURI strictURIParserOptions "ftp://ftp.is.co.za/rfc/rfc1808.txt"+ , roundtripTestURI strictURIParserOptions "http://www.ietf.org/rfc/rfc2396.txt"+ , roundtripTestURI strictURIParserOptions "mailto:John.Doe@example.com"+ , roundtripTestURI strictURIParserOptions "news:comp.infosystems.www.servers.unix"+ , roundtripTestURI strictURIParserOptions "tel:+1-816-555-1212"+ , roundtripTestURI strictURIParserOptions "telnet://192.0.2.16:80/"+ -- RFC 3986, Section 4.2 , parseTestRelativeRef strictURIParserOptions "verysimple" $ Right $ RelativeRef@@ -248,6 +256,12 @@ -> TestTree parseTestURI opts s r = testCase (B8.unpack s) $ parseURI opts s @?= r +roundtripTestURI+ :: URIParserOptions+ -> ByteString+ -> TestTree+roundtripTestURI opts s =+ testCase (B8.unpack s) $ (parseURI opts s >>= return . BB.toByteString . serializeURI) @?= Right s parseTestRelativeRef :: URIParserOptions
uri-bytestring.cabal view
@@ -1,5 +1,5 @@ name: uri-bytestring-version: 0.1.3+version: 0.1.4 synopsis: Haskell URI parsing as ByteStrings description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data. license: BSD3@@ -63,6 +63,7 @@ , derive , attoparsec , base+ , blaze-builder , bytestring , lens , quickcheck-instances