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

Function TestFormula

math/fibonacci/fibonacci_test.go:56–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestFormula(t *testing.T) {
57 tests := getTests()
58 for _, test := range tests {
59 t.Run(test.name, func(t *testing.T) {
60 if got := Formula(test.n); test.n <= 10 && got != test.want {
61 t.Errorf("Return value = %v, want %v", got, test.want)
62 }
63 })
64 }
65}
66
67func TestRecursive(t *testing.T) {
68 tests := getTests()

Callers

nothing calls this directly

Calls 2

FormulaFunction · 0.85
getTestsFunction · 0.70

Tested by

no test coverage detected