Tests
(t *testing.T)
| 4 | |
| 5 | // Tests |
| 6 | func TestProblem17_Func(t *testing.T) { |
| 7 | tests := []struct { |
| 8 | name string |
| 9 | input string |
| 10 | want int |
| 11 | }{ |
| 12 | {"1 to 5", "one two three four five", 19}, |
| 13 | {"1 to 1000", INPUT, 21124}, |
| 14 | } |
| 15 | |
| 16 | for _, tt := range tests { |
| 17 | t.Run(tt.name, func(t *testing.T) { |
| 18 | if got := Problem17(tt.input); got != tt.want { |
| 19 | t.Errorf("Problem17() = %v, want %v", got, tt.want) |
| 20 | } |
| 21 | }) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // Benchmark |
| 26 | func BenchmarkProblem17_Func(b *testing.B) { |
nothing calls this directly
no test coverage detected