mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-27 00:50:22 +08:00
21
mathUtil/min_test.go
Normal file
21
mathUtil/min_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package mathUtil
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestMinEmpty(t *testing.T) {
|
||||
s := []int{}
|
||||
var expected int = 0
|
||||
res := Min(s)
|
||||
if res != expected {
|
||||
t.Errorf("min error %d", res)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMin(t *testing.T) {
|
||||
s := []int{3, 7, 1, 9, 3, 0, 2, 2}
|
||||
var expected int = 0
|
||||
res := Min(s)
|
||||
if res != expected {
|
||||
t.Errorf("min error %d", res)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user