You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
696 B

  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. package cldr
  5. import "testing"
  6. func TestParseDraft(t *testing.T) {
  7. tests := []struct {
  8. in string
  9. draft Draft
  10. err bool
  11. }{
  12. {"unconfirmed", Unconfirmed, false},
  13. {"provisional", Provisional, false},
  14. {"contributed", Contributed, false},
  15. {"approved", Approved, false},
  16. {"", Approved, false},
  17. {"foo", Approved, true},
  18. }
  19. for _, tt := range tests {
  20. if d, err := ParseDraft(tt.in); d != tt.draft || (err != nil) != tt.err {
  21. t.Errorf("%q: was %v, %v; want %v, %v", tt.in, d, err != nil, tt.draft, tt.err)
  22. }
  23. }
  24. }