(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func TestProgressBarOutputFormat(t *testing.T) { |
| 249 | t.Run("non-TTY format structure", func(t *testing.T) { |
| 250 | // This test verifies the output format structure |
| 251 | // Skip if running in TTY mode |
| 252 | if isTTY() { |
| 253 | t.Skip("Test requires non-TTY mode") |
| 254 | } |
| 255 | |
| 256 | bar := NewProgressBar(1024 * 1024) // 1MB |
| 257 | output := bar.Update(512 * 1024) // 512KB |
| 258 | |
| 259 | // Should contain: percentage, current size, total size |
| 260 | assert.Contains(t, output, "%", "Output should contain percentage symbol") |
| 261 | assert.Regexp(t, `KB|MB`, output, "Output should contain size units") |
| 262 | assert.Contains(t, output, "/", "Output should contain separator between current and total") |
| 263 | }) |
| 264 | } |
| 265 | |
| 266 | func TestProgressBarEdgeCases(t *testing.T) { |
| 267 | t.Run("current exceeds total", func(t *testing.T) { |
nothing calls this directly
no test coverage detected