Skip to content

Commit

Permalink
adjust tests to match the new idea
Browse files Browse the repository at this point in the history
  • Loading branch information
droppingin committed Aug 30, 2022
1 parent 049b698 commit 33f3421
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 71 deletions.
4 changes: 2 additions & 2 deletions testdata/day.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func main() {
ck(Friday, "Friday")
ck(Saturday, "Saturday")
ck(Sunday, "Sunday")
ck(-127, "Day(-127)")
ck(127, "Day(127)")
ck(-127, "")
ck(127, "")
ckDayString(Sunday, "Sunday")
ckDayString(Sunday, "sunday")

Expand Down
10 changes: 5 additions & 5 deletions testdata/gap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const (
)

func main() {
ck(0, "Gap(0)")
ck(1, "Gap(1)")
ck(0, "")
ck(1, "")
ck(Two, "Two")
ck(Three, "Three")
ck(4, "Gap(4)")
ck(4, "")
ck(Five, "Five")
ck(Six, "Six")
ck(Seven, "Seven")
ck(Eight, "Eight")
ck(Nine, "Nine")
ck(10, "Gap(10)")
ck(10, "")
ck(Eleven, "Eleven")
ck(12, "Gap(12)")
ck(12, "")
}

func ck(gap Gap, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/num.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const (
)

func main() {
ck(-3, "Num(-3)")
ck(-3, "")
ck(m_2, "m_2")
ck(m_1, "m_1")
ck(m0, "m0")
ck(m1, "m1")
ck(m2, "m2")
ck(3, "Num(3)")
ck(3, "")
}

func ck(num Num, str string) {
Expand Down
2 changes: 1 addition & 1 deletion testdata/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func main() {
ck(Two, "Two")
ck(Three, "Three")
ck(AnotherOne, "One")
ck(127, "Number(127)")
ck(127, "")
}

func ck(num Number, str string) {
Expand Down
8 changes: 4 additions & 4 deletions testdata/prime.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const (
)

func main() {
ck(0, "Prime(0)")
ck(1, "Prime(1)")
ck(0, "")
ck(1, "")
ck(p2, "p2")
ck(p3, "p3")
ck(4, "Prime(4)")
ck(4, "")
ck(p5, "p5")
ck(p7, "p7")
ck(p77, "p7")
Expand All @@ -46,7 +46,7 @@ func main() {
ck(p37, "p37")
ck(p41, "p41")
ck(p43, "p43")
ck(44, "Prime(44)")
ck(44, "")
}

func ck(prime Prime, str string) {
Expand Down
20 changes: 10 additions & 10 deletions testdata/thresholdeq.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ const (
)

func main() {
ck(1, "Thresholdeq(1)")
ck(1, "")
ck(req1, "req1")
ck(3, "Thresholdeq(3)")
ck(3, "")
ck(req2, "req2")
ck(5, "Thresholdeq(5)")
ck(5, "")
ck(req3, "req3")
ck(7, "Thresholdeq(7)")
ck(7, "")
ck(req4, "req4")
ck(9, "Thresholdeq(9)")
ck(9, "")
ck(req5, "req5")
ck(11, "Thresholdeq(11)")
ck(11, "")
ck(req6, "req6")
ck(13, "Thresholdeq(13)")
ck(13, "")
ck(req7, "req7")
ck(15, "Thresholdeq(15)")
ck(15, "")
ck(req8, "req8")
ck(17, "Thresholdeq(17)")
ck(17, "")
ck(req9, "req9")
ck(19, "Thresholdeq(19)")
ck(19, "")
ck(req10, "req10")
}

Expand Down
24 changes: 12 additions & 12 deletions testdata/thresholdgt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ const (
)

func main() {
ck(1, "Thresholdgt(1)")
ck(1, "")
ck(rgt1, "rgt1")
ck(3, "Thresholdgt(3)")
ck(3, "")
ck(rgt2, "rgt2")
ck(5, "Thresholdgt(5)")
ck(5, "")
ck(rgt3, "rgt3")
ck(7, "Thresholdgt(7)")
ck(7, "")
ck(rgt4, "rgt4")
ck(9, "Thresholdgt(9)")
ck(9, "")
ck(rgt5, "rgt5")
ck(11, "Thresholdgt(11)")
ck(11, "")
ck(rgt6, "rgt6")
ck(13, "Thresholdgt(13)")
ck(13, "")
ck(rgt7, "rgt7")
ck(15, "Thresholdgt(15)")
ck(15, "")
ck(rgt8, "rgt8")
ck(17, "Thresholdgt(17)")
ck(17, "")
ck(rgt9, "rgt9")
ck(19, "Thresholdgt(19)")
ck(19, "")
ck(rgt10, "rgt10")
ck(21, "Thresholdgt(21)")
ck(21, "")
ck(rgt11, "rgt11")
}

func ck(thresholdgt Thresholdgt, str string) {
if fmt.Sprint(thresholdgt) != str {
panic("thresholdgt.go: " + str)
}
}
}
18 changes: 9 additions & 9 deletions testdata/thresholdlt.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ const (
)

func main() {
ck(1, "Thresholdlt(1)")
ck(1, "")
ck(rlt1, "rlt1")
ck(3, "Thresholdlt(3)")
ck(3, "")
ck(rlt2, "rlt2")
ck(5, "Thresholdlt(5)")
ck(5, "")
ck(rlt3, "rlt3")
ck(7, "Thresholdlt(7)")
ck(7, "")
ck(rlt4, "rlt4")
ck(9, "Thresholdlt(9)")
ck(9, "")
ck(rlt5, "rlt5")
ck(11, "Thresholdlt(11)")
ck(11, "")
ck(rlt6, "rlt6")
ck(13, "Thresholdlt(13)")
ck(13, "")
ck(rlt7, "rlt7")
ck(15, "Thresholdlt(15)")
ck(15, "")
ck(rlt8, "rlt8")
ck(17, "Thresholdlt(17)")
ck(17, "")
ck(rlt9, "rlt9")
}

Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_first.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(Male, "M")
ck(Female, "F")
ck(unknown, "u")
ck(-127, "FirstCaseValue(-127)")
ck(127, "FirstCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value FirstCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_first_lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(Male, "m")
ck(Female, "f")
ck(Unknown, "u")
ck(-127, "FirstLowerCaseValue(-127)")
ck(127, "FirstLowerCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value FirstLowerCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_first_upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(male, "M")
ck(female, "F")
ck(unknown, "U")
ck(-127, "FirstUpperCaseValue(-127)")
ck(127, "FirstUpperCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value FirstUpperCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_kebab.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(KebabCaseValueOne, "kebab-case-value-one")
ck(KebabCaseValueTwo, "kebab-case-value-two")
ck(KebabCaseValueThree, "kebab-case-value-three")
ck(-127, "KebabCaseValue(-127)")
ck(127, "KebabCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value KebabCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_kebab_upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(KebabUpperCaseValueOne, "KEBAB-UPPER-CASE-VALUE-ONE")
ck(KebabUpperCaseValueTwo, "KEBAB-UPPER-CASE-VALUE-TWO")
ck(KebabUpperCaseValueThree, "KEBAB-UPPER-CASE-VALUE-THREE")
ck(-127, "KebabUpperCaseValue(-127)")
ck(127, "KebabUpperCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value KebabUpperCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(LowerCaseValueOne, "lowercasevalueone")
ck(LowerCaseValueTwo, "lowercasevaluetwo")
ck(LowerCaseValueThree, "lowercasevaluethree")
ck(-127, "LowerCaseValue(-127)")
ck(127, "LowerCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value LowerCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_snake.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(SnakeCaseValueOne, "snake_case_value_one")
ck(SnakeCaseValueTwo, "snake_case_value_two")
ck(SnakeCaseValueThree, "snake_case_value_three")
ck(-127, "SnakeCaseValue(-127)")
ck(127, "SnakeCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value SnakeCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_snake_upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(SnakeUpperCaseValueOne, "SNAKE_UPPER_CASE_VALUE_ONE")
ck(SnakeUpperCaseValueTwo, "SNAKE_UPPER_CASE_VALUE_TWO")
ck(SnakeUpperCaseValueThree, "SNAKE_UPPER_CASE_VALUE_THREE")
ck(-127, "SnakeUpperCaseValue(-127)")
ck(127, "SnakeUpperCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value SnakeUpperCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(titlecasevalueone, "Titlecasevalueone")
ck(titlecasevaluetwo, "Titlecasevaluetwo")
ck(titlecasevaluethree, "Titlecasevaluethree")
ck(-127, "TitleCaseValue(-127)")
ck(127, "TitleCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value TitleCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(UpperCaseValueOne, "UPPERCASEVALUEONE")
ck(UpperCaseValueTwo, "UPPERCASEVALUETWO")
ck(UpperCaseValueThree, "UPPERCASEVALUETHREE")
ck(-127, "UpperCaseValue(-127)")
ck(127, "UpperCaseValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value UpperCaseValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/transform_whitespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func main() {
ck(WhitespaceSeparatedValueOne, "whitespace separated value one")
ck(WhitespaceSeparatedValueTwo, "whitespace separated value two")
ck(WhitespaceSeparatedValueThree, "whitespace separated value three")
ck(-127, "WhitespaceSeparatedValue(-127)")
ck(127, "WhitespaceSeparatedValue(127)")
ck(-127, "")
ck(127, "")
}

func ck(value WhitespaceSeparatedValue, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/unum.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const (
)

func main() {
ck(^Unum(0)-3, "Unum(252)")
ck(^Unum(0)-3, "")
ck(m_2, "m_2")
ck(m_1, "m_1")
ck(m0, "m0")
ck(m1, "m1")
ck(m2, "m2")
ck(3, "Unum(3)")
ck(3, "")
}

func ck(unum Unum, str string) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/unum2.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func main() {
ck(Zero, "Zero")
ck(One, "One")
ck(Two, "Two")
ck(3, "Unum2(3)")
ck(255, "Unum2(255)")
ck(3, "")
ck(255, "")
}

func ck(unum Unum2, str string) {
Expand Down

0 comments on commit 33f3421

Please sign in to comment.