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

Function TestAbs

math/binary/abs_test.go:5–14  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestAbs(t *testing.T) {
6 tests := getAbsTests()
7 for _, test := range tests {
8 t.Run(test.name, func(t *testing.T) {
9 if got := Abs(test.base, test.n); got != test.want {
10 t.Errorf("Abs() = %v, want %v", got, test.want)
11 }
12 })
13 }
14}
15
16func getAbsTests() []struct {
17 name string

Callers

nothing calls this directly

Calls 2

getAbsTestsFunction · 0.85
AbsFunction · 0.70

Tested by

no test coverage detected