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

Function TestProblem7_Func

project_euler/problem_7/problem7_test.go:6–33  ·  view source on GitHub ↗

Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

Problem7Function · 0.85

Tested by

no test coverage detected