fill with spaces instead of null chars
This commit is contained in:
1 parent
29c14533dd
commit
af113e71ef
3 files changed
+7
-32
No files matched your search
@@ -27,26 +27,6 @@ func TestIsRoot(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuneWidth(t *testing.T) {
|
||||
tests := []struct {
|
||||
r rune
|
||||
exp int
|
||||
}{
|
||||
{' ', 1},
|
||||
{'a', 1},
|
||||
{'ı', 1},
|
||||
{'ş', 1},
|
||||
{'世', 2},
|
||||
{'界', 2},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
if got := runeWidth(test.r); got != test.exp {
|
||||
t.Errorf("at input '%c' expected '%d' but got '%d'", test.r, test.exp, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuneSliceWidth(t *testing.T) {
|
||||
tests := []struct {
|
||||
rs []rune
|
||||
|
||||
Reference in new issue
Block a user