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

Function TestProblem10_Func

project_euler/problem_10/problem10_test.go:6–33  ·  view source on GitHub ↗

Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

4
5// Tests
6func TestProblem10_Func(t *testing.T) {
7 tests := []struct {
8 name string
9 input int
10 want uint
11 }{
12 {
13 name: "Testcase 1 - input 10",
14 input: 10,
15 want: 17,
16 },
17 {
18 name: "Testcase 2 - input 2000000",
19 input: 2000000,
20 want: 142913828922,
21 },
22 }
23
24 for _, tt := range tests {
25 t.Run(tt.name, func(t *testing.T) {
26 n := Problem10(tt.input)
27
28 if n != tt.want {
29 t.Errorf("Problem10() = %v, want %v", n, tt.want)
30 }
31 })
32 }
33}
34
35// Benchmarks
36func BenchmarkProblem10(b *testing.B) {

Callers

nothing calls this directly

Calls 1

Problem10Function · 0.85

Tested by

no test coverage detected