chore: import official kitty sources from upstream

Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty,
vendored at upstream commit 91fb38a without its git history.
This commit is contained in:
BlackAngelTV committed 2026-11-04 11:20:47 +01:00
commit 7e7d249099
1134 files changed
+433629

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
package wcswidth
import (
"fmt"
"strings"
"testing"
_ "embed"
"github.com/google/go-cmp/cmp"
"github.com/kovidgoyal/kitty"
)
var _ = fmt.Print
func TestSplitIntoGraphemes(t *testing.T) {
var m = map[string][]string{
" \u0308 ": {" \u0308", " "},
"abc": {"a", "b", "c"},
}
for text, expected := range m {
if diff := cmp.Diff(expected, SplitIntoGraphemes(text)); diff != "" {
t.Fatalf("Failed to split %#v into graphemes: %s", text, diff)
}
}
tests, err := kitty.LoadGraphemeBreakTests()
if err != nil {
t.Fatal(err)
}
for i, x := range tests {
text := strings.Join(x.Data, "")
actual := SplitIntoGraphemes(text)
if diff := cmp.Diff(x.Data, actual); diff != "" {
t.Fatalf("Failed test #%d: split %#v into graphemes (%s): %s", i, text, x.Comment, diff)
}
}
}