| 1 |
Description: Update test with different width that new go-runewidth version uses |
| 2 |
Author: Nilesh Patra <[email protected]> |
| 3 |
Last-Update: 2026-08-05 |
| 4 |
--- a/comparison/behavior_test.go |
| 5 |
+++ b/comparison/behavior_test.go |
| 6 |
@@ -87,9 +87,9 @@ |
| 7 |
expected: map[string]int{ |
| 8 |
"displaywidth_default": 6, // flags are always width 2 (modern standard) |
| 9 |
"displaywidth_options{}": 6, // same as default |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
+ "go-runewidth_default": 6, // go-runewidth treats flags as width 2 |
| 14 |
+ "go-runewidth_strict_false": 6, |
| 15 |
+ "go-runewidth_strict_true": 6, // go-runewidth always returns 2 for flags |
| 16 |
"uniseg_default": 6, // uniseg treats flags as width 2 |
| 17 |
}, |
| 18 |
}, |
| 19 |
@@ -138,7 +138,7 @@ |
| 20 |
expected: map[string]int{ |
| 21 |
"displaywidth_default": 16, // 6 + 4 + 2 + 2 + 2 |
| 22 |
"displaywidth_options{}": 16, // same as default |
| 23 |
|
| 24 |
+ "go-runewidth_default": 16, // 6 + 4 + 2 + 2 + 2 (flags are width 2) |
| 25 |
"uniseg_default": 16, // 6 + 4 + 2 + 2 + 2 |
| 26 |
}, |
| 27 |
}, |
| 28 |
--- a/comparison/strictemojineutral_test.go |
| 29 |
+++ b/comparison/strictemojineutral_test.go |
| 30 |
@@ -84,14 +84,14 @@ |
| 31 |
} |
| 32 |
|
| 33 |
// Document go-runewidth behavior (always 1) |
| 34 |
|
| 35 |
|
| 36 |
+ if grDefault != 2 { |
| 37 |
+ t.Errorf("%s: go-runewidth default should be 2, got %d", flag, grDefault) |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
+ if gr1 != 2 { |
| 42 |
+ t.Errorf("%s: go-runewidth with strict=false should be 2, got %d", flag, gr1) |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
+ if gr2 != 2 { |
| 47 |
+ t.Errorf("%s: go-runewidth with strict=true should be 2, got %d", flag, gr2) |
| 48 |
} |
| 49 |
} |
| 50 |
|