mirror of
https://github.com/antonmedv/fx
synced 2024-11-03 15:40:12 +00:00
27 lines
363 B
Go
27 lines
363 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func Test_clamp(t *testing.T) {
|
|
got := clamp(1, 2, 3)
|
|
if got != 2 {
|
|
t.Errorf("clamp() = %v, want 2", got)
|
|
}
|
|
|
|
}
|
|
|
|
func Test_max(t *testing.T) {
|
|
got := max(1, 2)
|
|
if got != 2 {
|
|
t.Errorf("max() = %v, want 2", got)
|
|
}
|
|
}
|
|
|
|
func Test_min(t *testing.T) {
|
|
got := min(1, 2)
|
|
if got != 1 {
|
|
t.Errorf("min() = %v, want 1", got)
|
|
}
|
|
|
|
}
|