package tui import "testing" func TestRemoveLastUTF8Rune(t *testing.T) { t.Parallel() tests := []struct { value string want string }{ {"", ""}, {"abc", "ab"}, {"café", "caf"}, {"日本", "日"}, {"🙂", ""}, {"a🙂", "a"}, } for _, tt := range tests { if got := removeLastUTF8Rune(tt.value); got != tt.want { t.Errorf("removeLastUTF8Rune(%q) = %q, want %q", tt.value, got, tt.want) } } }