1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix multibyte initial characters

This commit is contained in:
Ryooooooga
2021-10-23 20:46:37 +09:00
committed by Jesse Duffield
parent 253504a094
commit 6171690b00
3 changed files with 21 additions and 7 deletions

View File

@ -290,6 +290,16 @@ func TestLimitStr(t *testing.T) {
limit: 3,
want: "abc",
},
{
values: "あいう",
limit: 1,
want: "あ",
},
{
values: "あいう",
limit: 2,
want: "あい",
},
} {
if got := LimitStr(test.values, test.limit); !assert.EqualValues(t, got, test.want) {
t.Errorf("LimitString(%v, %d) = %v; want %v", test.values, test.limit, got, test.want)