diff options
Diffstat (limited to 'libgo/go/html/entity_test.go')
-rw-r--r-- | libgo/go/html/entity_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/go/html/entity_test.go b/libgo/go/html/entity_test.go index b53f866fa2d..6688ed2c43a 100644 --- a/libgo/go/html/entity_test.go +++ b/libgo/go/html/entity_test.go @@ -9,7 +9,15 @@ import ( "unicode/utf8" ) +func init() { + UnescapeString("") // force load of entity maps +} + func TestEntityLength(t *testing.T) { + if len(entity) == 0 || len(entity2) == 0 { + t.Fatal("maps not loaded") + } + // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key). // The +1 comes from the leading "&". This property implies that the length of // unescaped text is <= the length of escaped text. |