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

Function TestProblem15_Func

project_euler/problem_15/problem15_test.go:6–27  ·  view source on GitHub ↗

Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

4
5// Tests
6func TestProblem15_Func(t *testing.T) {
7 tests := []struct {
8 name string
9 input int
10 want int
11 }{
12 {"Input 2", 2, 6},
13 // This test case is disabled
14 // because it needs a big integer to run successfully
15 // and factorial package doesn't support it
16 // {"Input 20", 20, 137846528820},
17 }
18
19 for _, tt := range tests {
20 t.Run(tt.name, func(t *testing.T) {
21 got := Problem15(tt.input)
22 if got != tt.want {
23 t.Errorf("Problem15() = %v, want %v", got, tt.want)
24 }
25 })
26 }
27}
28
29// Benchmarks
30func BenchmarkProblem15_Func(b *testing.B) {

Callers

nothing calls this directly

Calls 1

Problem15Function · 0.85

Tested by

no test coverage detected