MCPcopy Index your code
hub / github.com/box-cli-maker/box-cli-maker / TestBuildPlainBar

Function TestBuildPlainBar

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

Source from the content-addressed store, hash-verified

378}
379
380func TestBuildPlainBar(t *testing.T) {
381 fill := "📦"
382 hw := runewidth.StringWidth(fill)
383 lineWidth := hw*10 + 2 // 10 emojis + 2 corners
384
385 left := fill
386 right := fill
387 bar := buildPlainBar(left, fill, right, hw, hw, lineWidth, hw)
388 if w := runewidth.StringWidth(bar); w != lineWidth {
389 t.Fatalf("expected bar visual width %d, got %d", lineWidth, w)
390 }
391 if !strings.HasPrefix(bar, fill) || !strings.HasSuffix(bar, fill) {
392 t.Errorf("expected bar to start and end with fill, got %q", bar)
393 }
394}
395
396func TestBuildTitledBar_LeftAlignedWithEmojiFill(t *testing.T) {
397 fill := "📦"

Callers

nothing calls this directly

Calls 1

buildPlainBarFunction · 0.85

Tested by

no test coverage detected