Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 259c3fb

Browse files
committed
Add math_test.go
1 parent f4e100f commit 259c3fb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

math_test.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package datautils
2+
3+
import "testing"
4+
5+
func TestMax(t *testing.T) {
6+
data := []struct {
7+
x int64
8+
y int64
9+
m int64
10+
}{
11+
{1, 1, 1},
12+
{1, 2, 2},
13+
{2, 1, 2},
14+
}
15+
16+
for _, d := range data {
17+
max := Max(d.x, d.y)
18+
if max != d.m {
19+
t.Errorf("Max(%d, %d) was wrong: %d is not %d", d.x, d.y, max, d.m)
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)