MCPcopy Index your code
hub / github.com/dnote/dnote / TestGetPath

Function TestGetPath

pkg/server/helpers/url_test.go:25–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestGetPath(t *testing.T) {
26 t.Run("without query", func(t *testing.T) {
27 // execute
28 got := GetPath("/some-path", nil)
29
30 // test
31 assert.Equal(t, got, "/some-path", "got mismatch")
32 })
33
34 t.Run("with query", func(t *testing.T) {
35 // execute
36 q := url.Values{}
37 q.Set("foo", "bar")
38 q.Set("baz", "/quz")
39 got := GetPath("/some-path", &q)
40
41 // test
42 assert.Equal(t, got, "/some-path?baz=%2Fquz&foo=bar", "got mismatch")
43 })
44}

Callers

nothing calls this directly

Calls 2

EqualFunction · 0.92
GetPathFunction · 0.70

Tested by

no test coverage detected