forked from Soostone/uri-bytestring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to parse a valid URI even if there's junk at the end.
- Loading branch information
Showing
2 changed files
with
12 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,8 +146,8 @@ parseUriTests = | |
"/foo" | ||
mempty | ||
(Just ""), | ||
testParseFailure "http://www.example.org/foo#bar#baz" MalformedFragment, | ||
testParseFailure "https://www.example.org?listParam[]=foo,bar" MalformedQuery, | ||
testParseFailure "http://www.example.org/foo#bar#baz" (OtherError "endOfInput"), | ||
testParseFailure "https://www.example.org?listParam[]=foo,bar" (OtherError "endOfInput"), | ||
testParsesLax "https://www.example.org?listParam[]=foo,bar" $ | ||
URI | ||
(Scheme "https") | ||
|
@@ -201,9 +201,9 @@ parseUriTests = | |
(Query []) | ||
Nothing, | ||
parseTestURI strictURIParserOptions "file:///foo/%F" $ | ||
Left MalformedPath, | ||
Left (OtherError "endOfInput"), | ||
parseTestURI strictURIParserOptions "file:///foo/?foo=%F" $ | ||
Left MalformedQuery, | ||
Left (OtherError "endOfInput"), | ||
roundtripTestURI strictURIParserOptions "ftp://ftp.is.co.za/rfc/rfc1808.txt", | ||
roundtripTestURI strictURIParserOptions "http://www.ietf.org/rfc/rfc2396.txt", | ||
roundtripTestURI strictURIParserOptions "mailto:[email protected]", | ||
|
@@ -219,7 +219,7 @@ parseUriTests = | |
(Query []) | ||
Nothing, | ||
parseTestRelativeRef strictURIParserOptions "this:that/thap/sub?1=2" $ | ||
Left $ MalformedPath, | ||
Left (OtherError "endOfInput"), | ||
parseTestRelativeRef strictURIParserOptions "./this:that/thap/sub?1=2" $ | ||
Right $ | ||
RelativeRef | ||
|