MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / TestInterpolationNames

Function TestInterpolationNames

checks/http_test.go:25–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestInterpolationNames(t *testing.T) {
26 got := InterpolationNames("${baseURL}/users/${id}/${id}")
27 want := []string{"baseURL", "id", "id"}
28 if len(got) != len(want) {
29 t.Fatalf("InterpolationNames() = %#v, want %#v", got, want)
30 }
31 for i := range want {
32 if got[i] != want[i] {
33 t.Fatalf("InterpolationNames() = %#v, want %#v", got, want)
34 }
35 }
36}
37
38func TestRunHTTPRequestInterpolatesRequestAndCapturesResponseVariables(t *testing.T) {
39 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 1

InterpolationNamesFunction · 0.85

Tested by

no test coverage detected