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

Function TestProblem12_Func

project_euler/problem_12/problem12_test.go:5–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestProblem12_Func(t *testing.T) {
6 tests := []struct {
7 name string
8 input uint
9 want uint
10 }{
11 {"Test Case 1", 6, 28},
12 {"Test Case 2", 7, 36},
13 {"Test Case 3", 11, 120},
14 {"Test Case 4", 500, 76576500},
15 }
16
17 for _, tt := range tests {
18 t.Run(tt.name, func(t *testing.T) {
19 actual := Problem12(tt.input)
20 if actual != tt.want {
21 t.Errorf("Expected: %v, but got %v", tt.want, actual)
22 }
23 })
24 }
25}
26
27func BenchmarkProblem12_Func(b *testing.B) {
28 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 1

Problem12Function · 0.85

Tested by

no test coverage detected