~vtuson/scopecreator/twitter-template

« back to all changes in this revision

Viewing changes to src/go/src/code.google.com/p/go.text/cldr/cldr_test.go

  • Committer: Victor Palau
  • Date: 2015-03-11 14:24:42 UTC
  • Revision ID: vtuson@gmail.com-20150311142442-f2pxp111c8ynv232
public release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2014 The Go Authors. All rights reserved.
 
2
// Use of this source code is governed by a BSD-style
 
3
// license that can be found in the LICENSE file.
 
4
 
 
5
package cldr
 
6
 
 
7
import "testing"
 
8
 
 
9
func TestParseDraft(t *testing.T) {
 
10
        tests := []struct {
 
11
                in    string
 
12
                draft Draft
 
13
                err   bool
 
14
        }{
 
15
                {"unconfirmed", Unconfirmed, false},
 
16
                {"provisional", Provisional, false},
 
17
                {"contributed", Contributed, false},
 
18
                {"approved", Approved, false},
 
19
                {"", Approved, false},
 
20
                {"foo", Approved, true},
 
21
        }
 
22
        for _, tt := range tests {
 
23
                if d, err := ParseDraft(tt.in); d != tt.draft || (err != nil) != tt.err {
 
24
                        t.Errorf("%q: was %v, %v; want %v, %v", tt.in, d, err != nil, tt.draft, tt.err)
 
25
                }
 
26
        }
 
27
}