Skip to content

Commit 1dae473

Browse files
committed
unicode/utf8: add test for FullRune
Check that it now properly handles \xC0 and \xC1. Fixes #11733. Change-Id: I66cfe0d43f9d123d4c4509a3fa18b9b6380dfc39 Reviewed-on: https://go-review.googlesource.com/17225 Reviewed-by: Russ Cox <rsc@golang.org>
1 parent f000523 commit 1dae473

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: src/unicode/utf8/utf8_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ func TestFullRune(t *testing.T) {
100100
t.Errorf("FullRune(%q) = true, want false", s1)
101101
}
102102
}
103+
for _, s := range []string{"\xc0", "\xc1"} {
104+
b := []byte(s)
105+
if !FullRune(b) {
106+
t.Errorf("FullRune(%q) = false, want true", s)
107+
}
108+
if !FullRuneInString(s) {
109+
t.Errorf("FullRuneInString(%q) = false, want true", s)
110+
}
111+
}
103112
}
104113

105114
func TestEncodeRune(t *testing.T) {

0 commit comments

Comments
 (0)