make gemQuery field of GemURL optional (with Maybe)

This commit is contained in:
2021-10-24 18:54:41 -04:00
parent a2d8f1a5ea
commit a5d0c25fc3
3 changed files with 10 additions and 7 deletions

View File

@@ -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"