~ubuntu-branches/ubuntu/wily/golang-x-text/wily

« back to all changes in this revision

Viewing changes to language/parse_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-10-19 22:03:07 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20151019220307-06qbha67qp4yf5gn
Tags: 0+git20151019.0fe7e68-0ubuntu1
New upstream snapshot, resolving FTBFS with golang 1.5 and supporting
MIR of juju (see http://pad.lv/1267393).

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
        "bytes"
9
9
        "strings"
10
10
        "testing"
 
11
 
 
12
        "golang.org/x/text/internal/tag"
11
13
)
12
14
 
13
15
type scanTest struct {
50
52
                for j := 0; !scan.done; j++ {
51
53
                        if j >= len(tt.tok) {
52
54
                                t.Errorf("%d: extra token %q", i, scan.token)
53
 
                        } else if cmp(tt.tok[j], scan.token) != 0 {
 
55
                        } else if tag.Compare(tt.tok[j], scan.token) != 0 {
54
56
                                t.Errorf("%d: token %d: found %q; want %q", i, j, scan.token, tt.tok[j])
55
57
                                break
56
58
                        }
57
59
                        scan.scan()
58
60
                }
59
 
                if s := strings.Join(tt.tok, "-"); cmp(s, bytes.Replace(scan.b, b("_"), b("-"), -1)) != 0 {
 
61
                if s := strings.Join(tt.tok, "-"); tag.Compare(s, bytes.Replace(scan.b, b("_"), b("-"), -1)) != 0 {
60
62
                        t.Errorf("%d: input: found %q; want %q", i, scan.b, s)
61
63
                }
62
64
                if (scan.err == nil) != tt.ok {