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

Function getTests

math/abs_test.go:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func getTests() []struct {
21 name string
22 n int
23 want int
24} {
25 tests := []struct {
26 name string
27 n int
28 want int
29 }{
30 {"-1 = |1| ", -1, 1},
31 {"-255 = |255| ", -255, 255},
32 {"0 = |0| ", 0, 0},
33 {"5 = |5| ", 5, 5},
34 {"-5 = |5| ", -5, 5},
35 {"-98368972 = |98368972| ", -98368972, 98368972},
36 }
37 return tests
38}
39
40func BenchmarkSimpleAbs(b *testing.B) {
41 for i := 0; i < b.N; i++ {

Callers 1

TestAbsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected