summaryrefslogtreecommitdiff
path: root/request_test.go
blob: 0da744f4b8228be518338e19160366e7434f9cce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
			}
		})
	}
}