mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-09 08:32:01 -07:00
Reorganize source code
This commit is contained in:
22
src/util/util_test.go
Normal file
22
src/util/util_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package util
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestMax(t *testing.T) {
|
||||
if Max(-2, 5, 1, 4, 3) != 5 {
|
||||
t.Error("Invalid result")
|
||||
}
|
||||
}
|
||||
|
||||
func TestContrain(t *testing.T) {
|
||||
if Constrain(-3, -1, 3) != -1 {
|
||||
t.Error("Expected", -1)
|
||||
}
|
||||
if Constrain(2, -1, 3) != 2 {
|
||||
t.Error("Expected", 2)
|
||||
}
|
||||
|
||||
if Constrain(5, -1, 3) != 3 {
|
||||
t.Error("Expected", 3)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user