We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0b957e commit 94fc951Copy full SHA for 94fc951
1 file changed
width_test.go
@@ -244,8 +244,16 @@ func TestCalculateWidth(t *testing.T) {
244
}
245
246
247
-// Intended to discover differences between displaywidth and go-runewidth
+// 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.
250
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
+
257
for r := rune(0); r <= unicode.MaxRune; r++ {
258
w1 := Rune(r)
259
w2 := runewidth.RuneWidth(r)
0 commit comments