Files
go-easy-utils/mathUtil/abs_test.go
jeffery f97913a2bc Feature/math util (#22)
Development supports the math package
2023-04-12 11:10:07 +08:00

22 lines
351 B
Go

package mathUtil
import "testing"
func TestAbsInt64(t *testing.T) {
var input int64 = -12
var expected int64 = 12
res := Abs(input)
if res != expected {
t.Errorf("abs error")
}
}
func TestAbsFloat32(t *testing.T) {
var input float32 = -12.4
var expected float32 = 12.4
res := Abs(input)
if res != expected {
t.Errorf("abs error")
}
}