From 2ef530daa47b301a40c1ee93cd43b8f36fc68c0b Mon Sep 17 00:00:00 2001 From: tjpcc Date: Tue, 17 Jan 2023 15:59:29 -0700 Subject: pull request, response, handlers out of the gemini package --- request_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 request_test.go (limited to 'request_test.go') 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) + } + }) + } +} -- cgit v1.2.3