MCPcopy Index your code
hub / github.com/databus23/helm-diff / TestDebugPrint

Function TestDebugPrint

cmd/helpers_test.go:71–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestDebugPrint(t *testing.T) {
72 tests := []struct {
73 name string
74 envValue string
75 expected string
76 }{
77 {
78 name: "non-empty when HELM_DEBUG is true",
79 envValue: "true",
80 expected: "test\n",
81 },
82 {
83 name: "empty when HELM_DEBUG is false",
84 envValue: "false",
85 expected: "",
86 },
87 }
88
89 for _, tt := range tests {
90 t.Run(tt.name, func(t *testing.T) {
91 t.Setenv("HELM_DEBUG", tt.envValue)
92 output, err := captureStdout(func() {
93 debugPrint("test")
94 })
95 require.NoError(t, err)
96 require.Equalf(t, tt.expected, output, "Expected %v but got %v", tt.expected, output)
97 })
98 }
99}
100
101func TestOutputWithRichError(t *testing.T) {
102 tests := []struct {

Callers

nothing calls this directly

Calls 2

captureStdoutFunction · 0.85
debugPrintFunction · 0.85

Tested by

no test coverage detected