make gemQuery field of GemURL optional (with Maybe)
This commit is contained in:
@@ -45,6 +45,7 @@ encodeGemURLSpec = describe "encodeGemURL" $ mapM_
|
||||
, ( "with port", withPortURL, withPortExp )
|
||||
, ( "with path", withPathURL, withPathExp )
|
||||
, ( "with query", withQueryURL, withQueryExp )
|
||||
, ( "blank query", blankQueryURL, blankQueryExp )
|
||||
, ( "with escape", withEscapeURL, withEscapeExp )
|
||||
]
|
||||
|
||||
@@ -55,12 +56,14 @@ encodeGemURLSpec = describe "encodeGemURL" $ mapM_
|
||||
withPortExp = "gemini://example.com:1965/"
|
||||
withPathURL = simpleURL { gemPath = ["foo", "bar"] }
|
||||
withPathExp = "gemini://example.com/foo/bar"
|
||||
withQueryURL = simpleURL { gemQuery = "foo" }
|
||||
withQueryURL = simpleURL { gemQuery = Just "foo" }
|
||||
withQueryExp = "gemini://example.com/?foo"
|
||||
blankQueryURL = simpleURL { gemQuery = Just "" }
|
||||
blankQueryExp = "gemini://example.com/?"
|
||||
|
||||
withEscapeURL = simpleURL
|
||||
{ gemPath = ["foo bar"]
|
||||
, gemQuery = "baz quux"
|
||||
, gemQuery = Just "baz quux"
|
||||
}
|
||||
|
||||
withEscapeExp = "gemini://example.com/foo%20bar?baz%20quux"
|
||||
|
||||
Reference in New Issue
Block a user