MCPcopy
hub / github.com/kubernetes/kubectl / TestPrinter

Function TestPrinter

pkg/cmd/diff/diff_test.go:91–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestPrinter(t *testing.T) {
92 printer := Printer{}
93
94 obj := &unstructured.Unstructured{Object: map[string]interface{}{
95 "string": "string",
96 "list": []int{1, 2, 3},
97 "int": 12,
98 }}
99 buf := bytes.Buffer{}
100 printer.Print(obj, &buf)
101 want := `int: 12
102list:
103- 1
104- 2
105- 3
106string: string
107`
108 if buf.String() != want {
109 t.Errorf("Print() = %q, want %q", buf.String(), want)
110 }
111}
112
113func TestDiffVersion(t *testing.T) {
114 diff, err := NewDiffVersion("MERGED")

Callers

nothing calls this directly

Calls 2

PrintMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…