summaryrefslogtreecommitdiff
path: root/libgo/go/unicode/utf8/utf8_test.go
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-04-03 10:55:16 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-04-03 10:55:16 -0700
commit6a14926b44504e88488e3715b5b84928d454fb49 (patch)
tree9cf5f80773922c62ebd9ba07388a1f27354dc516 /libgo/go/unicode/utf8/utf8_test.go
parentaabd700dee5d71eb0a8180fb3626a23da9a88fdd (diff)
parent749dea2a0549c126a0e992a6dd8e9b5eb28e1cee (diff)
downloadgcc-hjl/x32/java.tar.gz
Merge remote-tracking branch 'origin/master' into hjl/x32/javahjl/x32/java
Diffstat (limited to 'libgo/go/unicode/utf8/utf8_test.go')
-rw-r--r--libgo/go/unicode/utf8/utf8_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/libgo/go/unicode/utf8/utf8_test.go b/libgo/go/unicode/utf8/utf8_test.go
index 63514265bb9..4f73c8fb81a 100644
--- a/libgo/go/unicode/utf8/utf8_test.go
+++ b/libgo/go/unicode/utf8/utf8_test.go
@@ -7,9 +7,30 @@ package utf8_test
import (
"bytes"
"testing"
+ "unicode"
. "unicode/utf8"
)
+// Validate the constants redefined from unicode.
+func init() {
+ if MaxRune != unicode.MaxRune {
+ panic("utf8.MaxRune is wrong")
+ }
+ if RuneError != unicode.ReplacementChar {
+ panic("utf8.RuneError is wrong")
+ }
+}
+
+// Validate the constants redefined from unicode.
+func TestConstants(t *testing.T) {
+ if MaxRune != unicode.MaxRune {
+ t.Errorf("utf8.MaxRune is wrong: %x should be %x", MaxRune, unicode.MaxRune)
+ }
+ if RuneError != unicode.ReplacementChar {
+ t.Errorf("utf8.RuneError is wrong: %x should be %x", RuneError, unicode.ReplacementChar)
+ }
+}
+
type Utf8Map struct {
r rune
str string