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

Function getAbsTests

math/binary/abs_test.go:16–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16func getAbsTests() []struct {
17 name string
18 base int
19 n int
20 want int
21} {
22 tests := []struct {
23 name string
24 base int
25 n int
26 want int
27 }{
28 {"-1 = |1| ", 32, -1, 1},
29 {"-255 = |255| ", 32, -255, 255},
30 {"0 = |0| ", 64, 0, 0},
31 {"5 = |5| ", 16, 5, 5},
32 {"-5 = |5| ", 32, -5, 5},
33 {"-98368972 = |98368972| ", 64, -98368972, 98368972},
34 {"-110298368972 = |110298368972| ", 64, -98368972, 98368972},
35 }
36 return tests
37}

Callers 1

TestAbsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected