diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/pkg/utf16/utf16_test.go | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/pkg/utf16/utf16_test.go')
-rw-r--r-- | src/pkg/utf16/utf16_test.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pkg/utf16/utf16_test.go b/src/pkg/utf16/utf16_test.go index c0848aa38..2b9fb3d87 100644 --- a/src/pkg/utf16/utf16_test.go +++ b/src/pkg/utf16/utf16_test.go @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package utf16 +package utf16_test import ( "fmt" "reflect" "testing" "unicode" + . "utf16" ) type encodeTest struct { @@ -17,10 +18,10 @@ type encodeTest struct { } var encodeTests = []encodeTest{ - encodeTest{[]int{1, 2, 3, 4}, []uint16{1, 2, 3, 4}}, - encodeTest{[]int{0xffff, 0x10000, 0x10001, 0x12345, 0x10ffff}, + {[]int{1, 2, 3, 4}, []uint16{1, 2, 3, 4}}, + {[]int{0xffff, 0x10000, 0x10001, 0x12345, 0x10ffff}, []uint16{0xffff, 0xd800, 0xdc00, 0xd800, 0xdc01, 0xd808, 0xdf45, 0xdbff, 0xdfff}}, - encodeTest{[]int{'a', 'b', 0xd7ff, 0xd800, 0xdfff, 0xe000, 0x110000, -1}, + {[]int{'a', 'b', 0xd7ff, 0xd800, 0xdfff, 0xe000, 0x110000, -1}, []uint16{'a', 'b', 0xd7ff, 0xfffd, 0xfffd, 0xe000, 0xfffd, 0xfffd}}, } @@ -74,11 +75,11 @@ type decodeTest struct { } var decodeTests = []decodeTest{ - decodeTest{[]uint16{1, 2, 3, 4}, []int{1, 2, 3, 4}}, - decodeTest{[]uint16{0xffff, 0xd800, 0xdc00, 0xd800, 0xdc01, 0xd808, 0xdf45, 0xdbff, 0xdfff}, + {[]uint16{1, 2, 3, 4}, []int{1, 2, 3, 4}}, + {[]uint16{0xffff, 0xd800, 0xdc00, 0xd800, 0xdc01, 0xd808, 0xdf45, 0xdbff, 0xdfff}, []int{0xffff, 0x10000, 0x10001, 0x12345, 0x10ffff}}, - decodeTest{[]uint16{0xd800, 'a'}, []int{0xfffd, 'a'}}, - decodeTest{[]uint16{0xdfff}, []int{0xfffd}}, + {[]uint16{0xd800, 'a'}, []int{0xfffd, 'a'}}, + {[]uint16{0xdfff}, []int{0xfffd}}, } func TestDecode(t *testing.T) { |