(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestProblem12_Func(t *testing.T) { |
| 6 | tests := []struct { |
| 7 | name string |
| 8 | input uint |
| 9 | want uint |
| 10 | }{ |
| 11 | {"Test Case 1", 6, 28}, |
| 12 | {"Test Case 2", 7, 36}, |
| 13 | {"Test Case 3", 11, 120}, |
| 14 | {"Test Case 4", 500, 76576500}, |
| 15 | } |
| 16 | |
| 17 | for _, tt := range tests { |
| 18 | t.Run(tt.name, func(t *testing.T) { |
| 19 | actual := Problem12(tt.input) |
| 20 | if actual != tt.want { |
| 21 | t.Errorf("Expected: %v, but got %v", tt.want, actual) |
| 22 | } |
| 23 | }) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func BenchmarkProblem12_Func(b *testing.B) { |
| 28 | for i := 0; i < b.N; i++ { |
nothing calls this directly
no test coverage detected