From 519725bb3c075ee2462c929f5997cb068e18466a Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 26 Mar 2012 16:50:58 +0200 Subject: Imported Upstream version 2012.03.22 --- src/pkg/unicode/utf8/utf8_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/pkg/unicode/utf8/utf8_test.go') 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 -- cgit v1.2.3