]> Cypherpunks repositories - gostls13.git/commitdiff
unicode/utf8: add test for FullRune
authorMarcel van Lohuizen <mpvl@golang.org>
Thu, 26 Nov 2015 09:33:45 +0000 (10:33 +0100)
committerMarcel van Lohuizen <mpvl@golang.org>
Tue, 1 Dec 2015 10:39:06 +0000 (10:39 +0000)
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>
src/unicode/utf8/utf8_test.go

index 60ce362f09aad14f0a37a94509192ee530f1c09e..51571b61eb9f501276b205109aa181368e61815e 100644 (file)
@@ -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) {