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/max_test.go Normal file
View File

@@ -0,0 +1,21 @@
package mathUtil
import "testing"
func TestMaxEmpty(t *testing.T) {
s := []int{}
var expected int = 0
res := Max(s)
if res != expected {
t.Errorf("max error %d", res)
}
}
func TestMax(t *testing.T) {
s := []int{3, 7, 1, 9, 3, 0, 2, 2}
var expected int = 9
res := Max(s)
if res != expected {
t.Errorf("max error %d", res)
}
}