Feature/math util (#22)

Development supports the math package
This commit is contained in:
jeffery
2023-04-12 11:10:07 +08:00
committed by GitHub
parent 9a8c60b30a
commit f97913a2bc
30 changed files with 501 additions and 71 deletions

21
mathUtil/min_test.go Normal file
View 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)
}
}