Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(417)

Delta Between Two Patch Sets: src/pkg/exp/locale/collate/build/builder_test.go

Issue 6160044: code review 6160044: exp/locale/collate: from the regression test we derive ... (Closed)
Left Patch Set: Created 12 years, 10 months ago
Right Patch Set: diff -r a0eefa4e3d01 https://go.googlecode.com/hg Created 12 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/exp/locale/collate/build/colelem.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package build 5 package build
6 6
7 import "testing" 7 import "testing"
8 8
9 // cjk returns an implicit collation element for a CJK rune. 9 // cjk returns an implicit collation element for a CJK rune.
10 func cjk(r rune) [][]int { 10 func cjk(r rune) [][]int {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return b 56 return b
57 } 57 }
58 58
59 type convertTest struct { 59 type convertTest struct {
60 in, out [][]int 60 in, out [][]int
61 err bool 61 err bool
62 } 62 }
63 63
64 var convLargeTests = []convertTest{ 64 var convLargeTests = []convertTest{
65 {pCE(0xFB39), pCE(0xFB39), false}, 65 {pCE(0xFB39), pCE(0xFB39), false},
66 » {cjk(0x2F9B2), pqCE(0x7F4F2, 0x2F9B2), false}, 66 » {cjk(0x2F9B2), pqCE(0x4F4F2, 0x2F9B2), false},
67 {pCE(0xFB40), pCE(0), true}, 67 {pCE(0xFB40), pCE(0), true},
68 {append(pCE(0xFB40), pCE(0)[0]), pCE(0), true}, 68 {append(pCE(0xFB40), pCE(0)[0]), pCE(0), true},
69 {pCE(0xFFFE), pCE(illegalOffset), false}, 69 {pCE(0xFFFE), pCE(illegalOffset), false},
70 {pCE(0xFFFF), pCE(illegalOffset + 1), false}, 70 {pCE(0xFFFF), pCE(illegalOffset + 1), false},
71 } 71 }
72 72
73 func TestConvertLarge(t *testing.T) { 73 func TestConvertLarge(t *testing.T) {
74 for i, tt := range convLargeTests { 74 for i, tt := range convLargeTests {
75 e := &entry{elems: tt.in} 75 e := &entry{elems: tt.in}
76 elems, err := convertLargeWeights(e.elems) 76 elems, err := convertLargeWeights(e.elems)
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 256 }
257 ce := b.t.contractElem[offset+e.contractionIndex] 257 ce := b.t.contractElem[offset+e.contractionIndex]
258 if want, _ := makeCE(tt.ces[0]); want != ce { 258 if want, _ := makeCE(tt.ces[0]); want != ce {
259 t.Errorf("%s: element %X; want %X", tt.str, ce, want) 259 t.Errorf("%s: element %X; want %X", tt.str, ce, want)
260 } 260 }
261 } 261 }
262 if len(b.t.contractElem) != totalElements { 262 if len(b.t.contractElem) != totalElements {
263 t.Errorf("len(expandElem)==%d; want %d", len(b.t.contractElem), totalElements) 263 t.Errorf("len(expandElem)==%d; want %d", len(b.t.contractElem), totalElements)
264 } 264 }
265 } 265 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b