diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-22 15:25:43 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-23 12:25:28 +0200 |
commit | 7ec784e2a053b23809cabcad2750db6f2cac1698 (patch) | |
tree | 27eb4c7a4eb2541c0b789f1301caf847da913b16 /pkg | |
parent | 93af0016f777fb477263d44e4f7530a7b59bc53b (diff) |
Add test demonstrating wrong truncation of branch names containing non-ASCII characters
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/presentation/branches_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/gui/presentation/branches_test.go b/pkg/gui/presentation/branches_test.go index ba79f16ce..14012cda2 100644 --- a/pkg/gui/presentation/branches_test.go +++ b/pkg/gui/presentation/branches_test.go @@ -44,6 +44,16 @@ func Test_getBranchDisplayStrings(t *testing.T) { 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, fullDescription: false, @@ -185,6 +195,16 @@ func Test_getBranchDisplayStrings(t *testing.T) { 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, fullDescription: false, |