MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestFormatBranchPathTruncatesPath

Function TestFormatBranchPathTruncatesPath

internal/tui/picker_test.go:136–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestFormatBranchPathTruncatesPath(t *testing.T) {
137 p := &PRDPicker{}
138
139 result := p.formatBranchPath("chief/auth", ".chief/worktrees/auth/", 30)
140 // Should contain branch but path should be truncated with …
141 if !containsSubstring(result, "chief/auth") {
142 t.Errorf("expected branch in truncated output, got: %s", result)
143 }
144 runeCount := utf8.RuneCountInString(result)
145 if runeCount > 30 {
146 t.Errorf("expected result to fit within 30 display chars, got %d: %s", runeCount, result)
147 }
148}
149
150func TestFormatBranchPathTruncatesBranch(t *testing.T) {
151 p := &PRDPicker{}

Callers

nothing calls this directly

Calls 2

formatBranchPathMethod · 0.95
containsSubstringFunction · 0.85

Tested by

no test coverage detected