Tests
(t *testing.T)
| 4 | |
| 5 | // Tests |
| 6 | func TestProblem16_Func(t *testing.T) { |
| 7 | tests := []struct { |
| 8 | name string |
| 9 | exponent int64 |
| 10 | want int64 |
| 11 | }{ |
| 12 | {"2^15", 15, 26}, |
| 13 | {"2^1000", 1000, 1366}, |
| 14 | } |
| 15 | |
| 16 | for _, tt := range tests { |
| 17 | t.Run(tt.name, func(t *testing.T) { |
| 18 | if got := Problem16(tt.exponent); got != tt.want { |
| 19 | t.Errorf("Problem16() = %v, want %v", got, tt.want) |
| 20 | } |
| 21 | }) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // Benchmark |
| 26 | func BenchmarkProblem16_Func(b *testing.B) { |
nothing calls this directly
no test coverage detected