(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func 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 | |
| 101 | func TestOutputWithRichError(t *testing.T) { |
| 102 | tests := []struct { |
nothing calls this directly
no test coverage detected