summaryrefslogtreecommitdiff
path: root/request_test.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-01-17 15:59:29 -0700
committertjpcc <tjp@ctrl-c.club>2023-01-17 15:59:29 -0700
commit2ef530daa47b301a40c1ee93cd43b8f36fc68c0b (patch)
treeb9753719f5f0e5312bb5008d40f40247ce14e15a /request_test.go
parent30e21f8513d49661cb6e1583d301e34e898d48a9 (diff)
pull request, response, handlers out of the gemini package
Diffstat (limited to 'request_test.go')
-rw-r--r--request_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/request_test.go b/request_test.go
new file mode 100644
index 0000000..0da744f
--- /dev/null
+++ b/request_test.go
@@ -0,0 +1,24 @@
+package gus_test
+
+import (
+ "net/url"
+ "testing"
+
+ "tildegit.org/tjp/gus"
+)
+
+func TestUnescapedQuery(t *testing.T) {
+ table := []string{
+ "foo bar",
+ }
+
+ for _, test := range table {
+ t.Run(test, func(t *testing.T) {
+ u, _ := url.Parse("gemini://domain.com/path?" + url.QueryEscape(test))
+ result := gus.Request{URL: u}.UnescapedQuery()
+ if result != test {
+ t.Errorf("expected %q, got %q", test, result)
+ }
+ })
+ }
+}