MCPcopy
hub / github.com/kubernetes/client-go / compJSON

Function compJSON

plugin/pkg/client/auth/exec/exec_test.go:147–163  ·  view source on GitHub ↗
(t *testing.T, got, want []byte)

Source from the content-addressed store, hash-verified

145}
146
147func compJSON(t *testing.T, got, want []byte) {
148 t.Helper()
149 gotJSON := &bytes.Buffer{}
150 wantJSON := &bytes.Buffer{}
151
152 if err := json.Indent(gotJSON, got, "", " "); err != nil {
153 t.Errorf("got invalid JSON: %v", err)
154 }
155 if err := json.Indent(wantJSON, want, "", " "); err != nil {
156 t.Errorf("want invalid JSON: %v", err)
157 }
158 g := strings.TrimSpace(gotJSON.String())
159 w := strings.TrimSpace(wantJSON.String())
160 if g != w {
161 t.Errorf("wanted %q, got %q", w, g)
162 }
163}
164
165func TestRefreshCreds(t *testing.T) {
166 tests := []struct {

Callers 1

TestRefreshCredsFunction · 0.85

Calls 2

ErrorfMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected