mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Add test demonstrating wrong truncation of branch names containing non-ASCII characters
This commit is contained in:
@ -43,6 +43,16 @@ func Test_getBranchDisplayStrings(t *testing.T) {
|
||||
showDivergenceCfg: "none",
|
||||
expected: []string{"1m", "branch_name"},
|
||||
},
|
||||
{
|
||||
branch: &models.Branch{Name: "🍉_special_char", Recency: "1m"},
|
||||
itemOperation: types.ItemOperationNone,
|
||||
fullDescription: false,
|
||||
viewWidth: 19,
|
||||
useIcons: false,
|
||||
checkedOutByWorktree: false,
|
||||
showDivergenceCfg: "none",
|
||||
expected: []string{"1m", "🍉_special_c…"}, // truncated, but shouldn't
|
||||
},
|
||||
{
|
||||
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
|
||||
itemOperation: types.ItemOperationNone,
|
||||
@ -184,6 +194,16 @@ func Test_getBranchDisplayStrings(t *testing.T) {
|
||||
showDivergenceCfg: "none",
|
||||
expected: []string{"1m", "branch_na…"},
|
||||
},
|
||||
{
|
||||
branch: &models.Branch{Name: "🍉_special_char", Recency: "1m"},
|
||||
itemOperation: types.ItemOperationNone,
|
||||
fullDescription: false,
|
||||
viewWidth: 18,
|
||||
useIcons: false,
|
||||
checkedOutByWorktree: false,
|
||||
showDivergenceCfg: "none",
|
||||
expected: []string{"1m", "🍉_special_…"}, // truncated two runes too much
|
||||
},
|
||||
{
|
||||
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
|
||||
itemOperation: types.ItemOperationNone,
|
||||
|
Reference in New Issue
Block a user