enumer/testdata/transform_title.go

26 lines
443 B
Go
Raw Normal View History

package main
import "fmt"
type TitleCaseValue int
const (
titlecasevalueone TitleCaseValue = iota
titlecasevaluetwo
titlecasevaluethree
)
func main() {
ck(titlecasevalueone, "Titlecasevalueone")
ck(titlecasevaluetwo, "Titlecasevaluetwo")
ck(titlecasevaluethree, "Titlecasevaluethree")
2023-04-10 22:37:44 +03:00
ck(-127, "")
ck(127, "")
}
func ck(value TitleCaseValue, str string) {
if fmt.Sprint(value) != str {
panic("transform_title.go: " + str)
}
}