MCPcopy Create free account
hub / github.com/box-cli-maker/box-cli-maker / TestCharWidth

Function TestCharWidth

util_test.go:350–363  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

348}
349
350func TestCharWidth(t *testing.T) {
351 if w := charWidth("abc"); w != 3 {
352 t.Errorf("expected width 3 for 'abc', got %d", w)
353 }
354
355 colored := "\x1b[31mabc\x1b[0m" // red "abc"
356 if w := charWidth(colored); w != 3 {
357 t.Errorf("expected visible width 3 for colored 'abc', got %d", w)
358 }
359
360 if w := charWidth(""); w != 1 {
361 t.Errorf("expected fallback width 1 for empty string, got %d", w)
362 }
363}
364
365func TestBuildSegment(t *testing.T) {
366 fill := "📦"

Callers

nothing calls this directly

Calls 1

charWidthFunction · 0.85

Tested by

no test coverage detected