summaryrefslogtreecommitdiffstats
path: root/src/util/util_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util_test.go')
-rw-r--r--src/util/util_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/util_test.go b/src/util/util_test.go
index 42a66636..af0762b5 100644
--- a/src/util/util_test.go
+++ b/src/util/util_test.go
@@ -164,6 +164,18 @@ func TestRunesWidth(t *testing.T) {
t.Errorf("Expected overflow index: %d, actual: %d", args[2], overflowIdx)
}
}
+ for _, input := range []struct {
+ s string
+ w int
+ }{
+ {"▶", 1},
+ {"▶️", 2},
+ } {
+ width, _ := RunesWidth([]rune(input.s), 0, 0, 100)
+ if width != input.w {
+ t.Errorf("Expected width of %s: %d, actual: %d", input.s, input.w, width)
+ }
+ }
}
func TestTruncate(t *testing.T) {