diff options
Diffstat (limited to 'request_test.go')
-rw-r--r-- | request_test.go | 24 |
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) + } + }) + } +} |