Bism Allah

This commit is contained in:
bloeys
2022-06-10 02:23:49 +04:00
parent 3be1a9d0a7
commit 789fc396f7
3 changed files with 147 additions and 0 deletions

36
nlookup_test.go Executable file
View File

@ -0,0 +1,36 @@
package nlookup_test
import (
"testing"
"github.com/bloeys/nlookup"
)
func TestNLookup(t *testing.T) {
n := nlookup.NewNLookup[uint]()
IsEq(t, 1, cap(n.Data))
}
func AllTrue(t *testing.T, values ...bool) bool {
for i := 0; i < len(values); i++ {
if !values[i] {
t.Errorf("Expected 'true' but got 'false'\n")
}
}
return true
}
func IsEq[T comparable](t *testing.T, expected, val T) bool {
if val == expected {
return true
}
t.Errorf("Expected '%v' but got '%v'\n", expected, val)
return false
}