16 lines
282 B
Go
16 lines
282 B
Go
package mathutils_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
mathutils "git.mstar.dev/mstar/goutils/math"
|
|
)
|
|
|
|
func TestAbs(t *testing.T) {
|
|
if x := mathutils.Abs(-5); x != 5 {
|
|
t.Fatalf("Received %v, wanted 5", x)
|
|
}
|
|
if x := mathutils.Abs(6); x != 6 {
|
|
t.Fatalf("Received %v, wanted 6", x)
|
|
}
|
|
}
|