1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-29 16:55:23 -07:00

Add a few more tests (#1056)

* Add test for SumInts()

* Add a few more tests in utils

* Minor update for SumInts test
This commit is contained in:
David Bouchare
2021-03-01 17:33:42 +01:00
committed by GitHub
parent 7c12523139
commit cf3229e0cd
3 changed files with 54 additions and 1 deletions

View File

@@ -131,3 +131,32 @@ func Test_ReadFileBytes(t *testing.T) {
})
}
}
func Test_MaxInt(t *testing.T) {
expected := 3
result := MaxInt(3, 2)
assert.Equal(t, expected, result)
expected = 3
result = MaxInt(2, 3)
assert.Equal(t, expected, result)
}
func Test_Clamp(t *testing.T) {
expected := 6
result := Clamp(6, 3, 8)
assert.Equal(t, expected, result)
expected = 3
result = Clamp(1, 3, 8)
assert.Equal(t, expected, result)
expected = 8
result = Clamp(9, 3, 8)
assert.Equal(t, expected, result)
}