Skip to content

Commit 94fc951

Browse files
committed
Compat test only for Unicode version >=15
1 parent c0b957e commit 94fc951

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

width_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,16 @@ func TestCalculateWidth(t *testing.T) {
244244
}
245245
}
246246

247-
// Intended to discover differences between displaywidth and go-runewidth
247+
// Investigate differences between displaywidth and go-runewidth.
248+
// Not meant to be a real test, more of a tool, but good to
249+
// fail if something changes in the future.
248250
func TestCompatibility(t *testing.T) {
251+
if unicode.Version < "15" {
252+
// We only care about Unicode 15 and above,
253+
// which I believe was Go version 1.21.
254+
return
255+
}
256+
249257
for r := rune(0); r <= unicode.MaxRune; r++ {
250258
w1 := Rune(r)
251259
w2 := runewidth.RuneWidth(r)

0 commit comments

Comments
 (0)