uc_test.go 343 B

1234567891011121314151617181920212223
  1. package uc
  2. import "testing"
  3. type ucTest struct {
  4. in, out string
  5. }
  6. var ucTests = []ucTest{
  7. {"abc", "ABC"},
  8. {"cvo-az", "CVO-AZ"},
  9. {"Antwerp", "ANTWERP"},
  10. }
  11. func TestUC(t *testing.T) {
  12. for _, ut := range ucTests {
  13. uc := UpperCase(ut.in)
  14. if uc != ut.out {
  15. t.Errorf("UpperCase(%s) = %s, must be %s", ut.in, uc,
  16. ut.out)
  17. }
  18. }
  19. }