Description: Update test with different width that new go-runewidth version uses Author: Nilesh Patra Last-Update: 2026-08-05 --- a/comparison/behavior_test.go +++ b/comparison/behavior_test.go @@ -87,9 +87,9 @@ expected: map[string]int{ "displaywidth_default": 6, // flags are always width 2 (modern standard) "displaywidth_options{}": 6, // same as default - "go-runewidth_default": 3, // go-runewidth treats flags as width 1 - "go-runewidth_strict_false": 3, - "go-runewidth_strict_true": 3, // go-runewidth always returns 1 for flags + "go-runewidth_default": 6, // go-runewidth treats flags as width 2 + "go-runewidth_strict_false": 6, + "go-runewidth_strict_true": 6, // go-runewidth always returns 2 for flags "uniseg_default": 6, // uniseg treats flags as width 2 }, }, @@ -138,7 +138,7 @@ expected: map[string]int{ "displaywidth_default": 16, // 6 + 4 + 2 + 2 + 2 "displaywidth_options{}": 16, // same as default - "go-runewidth_default": 15, // 6 + 4 + 2 + 2 + 1 (flags are width 1) + "go-runewidth_default": 16, // 6 + 4 + 2 + 2 + 2 (flags are width 2) "uniseg_default": 16, // 6 + 4 + 2 + 2 + 2 }, }, --- a/comparison/strictemojineutral_test.go +++ b/comparison/strictemojineutral_test.go @@ -84,14 +84,14 @@ } // Document go-runewidth behavior (always 1) - if grDefault != 1 { - t.Errorf("%s: go-runewidth default should be 1, got %d", flag, grDefault) + if grDefault != 2 { + t.Errorf("%s: go-runewidth default should be 2, got %d", flag, grDefault) } - if gr1 != 1 { - t.Errorf("%s: go-runewidth with strict=false should be 1, got %d", flag, gr1) + if gr1 != 2 { + t.Errorf("%s: go-runewidth with strict=false should be 2, got %d", flag, gr1) } - if gr2 != 1 { - t.Errorf("%s: go-runewidth with strict=true should be 1, got %d", flag, gr2) + if gr2 != 2 { + t.Errorf("%s: go-runewidth with strict=true should be 2, got %d", flag, gr2) } }