MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestProblem17_Func

Function TestProblem17_Func

project_euler/problem_17/problem17_test.go:6–23  ·  view source on GitHub ↗

Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

4
5// Tests
6func 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
26func BenchmarkProblem17_Func(b *testing.B) {

Callers

nothing calls this directly

Calls 1

Problem17Function · 0.85

Tested by

no test coverage detected