mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-07 22:02:56 +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",
|
showDivergenceCfg: "none",
|
||||||
expected: []string{"1m", "branch_name"},
|
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"},
|
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
|
||||||
itemOperation: types.ItemOperationNone,
|
itemOperation: types.ItemOperationNone,
|
||||||
@@ -184,6 +194,16 @@ func Test_getBranchDisplayStrings(t *testing.T) {
|
|||||||
showDivergenceCfg: "none",
|
showDivergenceCfg: "none",
|
||||||
expected: []string{"1m", "branch_na…"},
|
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"},
|
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
|
||||||
itemOperation: types.ItemOperationNone,
|
itemOperation: types.ItemOperationNone,
|
||||||
|
Reference in New Issue
Block a user