diff options
author | Marcel van Lohuizen <mpvl@golang.org> | 2015-11-26 10:33:45 +0100 |
---|---|---|
committer | Marcel van Lohuizen <mpvl@golang.org> | 2015-12-01 10:39:06 +0000 |
commit | 1dae47378cd32c3bdc0351f7eed71bd3d3aaf364 (patch) | |
tree | 260e33bf244dc4c8a9b763a423fb112b2fa1d537 /src/unicode | |
parent | f000523018e80471f51e29cae117831157d8dfb8 (diff) | |
download | go-1dae47378cd32c3bdc0351f7eed71bd3d3aaf364.tar.gz go-1dae47378cd32c3bdc0351f7eed71bd3d3aaf364.zip |
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>
Diffstat (limited to 'src/unicode')
-rw-r--r-- | src/unicode/utf8/utf8_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unicode/utf8/utf8_test.go b/src/unicode/utf8/utf8_test.go index 60ce362f09..51571b61eb 100644 --- a/src/unicode/utf8/utf8_test.go +++ b/src/unicode/utf8/utf8_test.go @@ -100,6 +100,15 @@ func TestFullRune(t *testing.T) { t.Errorf("FullRune(%q) = true, want false", s1) } } + for _, s := range []string{"\xc0", "\xc1"} { + b := []byte(s) + if !FullRune(b) { + t.Errorf("FullRune(%q) = false, want true", s) + } + if !FullRuneInString(s) { + t.Errorf("FullRuneInString(%q) = false, want true", s) + } + } } func TestEncodeRune(t *testing.T) { |