MCPcopy Create free account
hub / github.com/archlinux-de/pkgstats-cli / TestPrintSearchURL

Function TestPrintSearchURL

internal/api/request/printer_test.go:22–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestPrintSearchURL(t *testing.T) {
23 var buffer bytes.Buffer
24 request.PrintSearchURL(&buffer, "/foo", "bar")
25
26 output := buffer.String()
27
28 if !regexp.MustCompile(`\s+/foo/packages\?query=bar\s+`).MatchString(output) {
29 t.Errorf("Unexpected output %s", output)
30 }
31}
32
33func TestPrintShowURL(t *testing.T) {
34 var buffer bytes.Buffer

Callers

nothing calls this directly

Calls 1

PrintSearchURLFunction · 0.92

Tested by

no test coverage detected