MCPcopy Create free account
hub / github.com/github/gh-aw / TestProgressBarOutputFormat

Function TestProgressBarOutputFormat

pkg/console/progress_test.go:248–264  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func 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
266func TestProgressBarEdgeCases(t *testing.T) {
267 t.Run("current exceeds total", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

UpdateMethod · 0.95
isTTYFunction · 0.70
NewProgressBarFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected