mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:55:28 +08:00
24 lines
343 B
Go
24 lines
343 B
Go
package uc
|
|
|
|
import "testing"
|
|
|
|
type ucTest struct {
|
|
in, out string
|
|
}
|
|
|
|
var ucTests = []ucTest{
|
|
{"abc", "ABC"},
|
|
{"cvo-az", "CVO-AZ"},
|
|
{"Antwerp", "ANTWERP"},
|
|
}
|
|
|
|
func TestUC(t *testing.T) {
|
|
for _, ut := range ucTests {
|
|
uc := UpperCase(ut.in)
|
|
if uc != ut.out {
|
|
t.Errorf("UpperCase(%s) = %s, must be %s", ut.in, uc,
|
|
ut.out)
|
|
}
|
|
}
|
|
}
|