TestConsoleFormatWarningMessageUsage verifies console.FormatWarningMessage is used correctly
(t *testing.T)
| 120 | |
| 121 | // TestConsoleFormatWarningMessageUsage verifies console.FormatWarningMessage is used correctly |
| 122 | func TestConsoleFormatWarningMessageUsage(t *testing.T) { |
| 123 | tests := []struct { |
| 124 | name string |
| 125 | message string |
| 126 | shouldContain []string |
| 127 | }{ |
| 128 | { |
| 129 | name: "simple warning", |
| 130 | message: "This is a warning", |
| 131 | shouldContain: []string{ |
| 132 | "This is a warning", |
| 133 | }, |
| 134 | }, |
| 135 | { |
| 136 | name: "warning with details", |
| 137 | message: "Failed to cleanup: directory not empty", |
| 138 | shouldContain: []string{ |
| 139 | "Failed to cleanup", |
| 140 | "directory not empty", |
| 141 | }, |
| 142 | }, |
| 143 | } |
| 144 | |
| 145 | for _, tt := range tests { |
| 146 | t.Run(tt.name, func(t *testing.T) { |
| 147 | formatted := console.FormatWarningMessage(tt.message) |
| 148 | |
| 149 | // Verify the formatted message contains the original text |
| 150 | for _, expected := range tt.shouldContain { |
| 151 | assert.Contains(t, formatted, expected, |
| 152 | "Formatted message should contain: %s", expected) |
| 153 | } |
| 154 | }) |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // TestErrorMessagePatterns verifies common error message patterns include helpful context |
| 159 | func TestErrorMessagePatterns(t *testing.T) { |
nothing calls this directly
no test coverage detected