MCPcopy
hub / github.com/cli/cli / TestHeadersAreNotMutated

Function TestHeadersAreNotMutated

internal/tableprinter/table_printer_test.go:11–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestHeadersAreNotMutated(t *testing.T) {
12 // Given a TTY environment so that headers are included in the table
13 ios, _, _, _ := iostreams.Test()
14 ios.SetStdoutTTY(true)
15
16 // When creating a new table printer
17 headers := []string{"one", "two", "three"}
18 _ = tableprinter.New(ios, tableprinter.WithHeader(headers...))
19
20 // The provided headers should not be mutated
21 require.Equal(t, []string{"one", "two", "three"}, headers)
22}

Callers

nothing calls this directly

Calls 5

TestFunction · 0.92
NewFunction · 0.92
WithHeaderFunction · 0.92
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected