/
niceSOFT
/
git-lfs
Обзор
Документация
Войти
/
niceSOFT
/
git-lfs
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/math_test.go
19 строк
369 B
Eng Zer Jun
Replace min/max helpers with built-in min/max
01 мар 2025, 11:48
Не верифицирован
01 мар 2025, 11:48
674fb21
Код
Авторство
О чём код?
package tools import ( "testing" "github.com/stretchr/testify/assert" ) func TestClampDiscardsIntsLowerThanMin(t *testing.T) { assert.Equal(t, 0, ClampInt(-1, 0, 1)) } func TestClampDiscardsIntsGreaterThanMax(t *testing.T) { assert.Equal(t, 1, ClampInt(2, 0, 1)) } func TestClampAcceptsIntsWithinBounds(t *testing.T) { assert.Equal(t, 1, ClampInt(1, 0, 2)) }