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
5package cldr
6
7import "testing"
8
9func 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}
28