diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
commit | 519725bb3c075ee2462c929f5997cb068e18466a (patch) | |
tree | 5b162e8488ad147a645048c073577821b4a2bee9 /src/pkg/unicode/utf8/utf8_test.go | |
parent | 842623c5dd2819d980ca9c58048d6bc6ed82475f (diff) | |
download | golang-upstream-weekly/2012.03.22.tar.gz |
Imported Upstream version 2012.03.22upstream-weekly/2012.03.22
Diffstat (limited to 'src/pkg/unicode/utf8/utf8_test.go')
-rw-r--r-- | src/pkg/unicode/utf8/utf8_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pkg/unicode/utf8/utf8_test.go b/src/pkg/unicode/utf8/utf8_test.go index 63514265b..4f73c8fb8 100644 --- a/src/pkg/unicode/utf8/utf8_test.go +++ b/src/pkg/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 |