mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-14 11:13:44 +08:00
23
mathUtil/ceil_test.go
Normal file
23
mathUtil/ceil_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package mathUtil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCeilFloat32(t *testing.T) {
|
||||
var input float32 = -12.4
|
||||
var expected int = -12
|
||||
res := Ceil(input)
|
||||
if res != expected {
|
||||
t.Errorf("ceil error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCeilFloat64(t *testing.T) {
|
||||
var input float64 = 12.4
|
||||
var expected int = 13
|
||||
res := Ceil(input)
|
||||
if res != expected {
|
||||
t.Errorf("ceil error")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user