summaryrefslogtreecommitdiff
path: root/set/set_test.go
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2020-11-05 09:42:08 +0000
committerPaul Buetow <git@mx.buetow.org>2020-11-05 09:42:08 +0000
commit24c2952ab16680383864625c8cc8cd73bfd94849 (patch)
tree39fe704420a995fbe98dad450d47094c5a54db34 /set/set_test.go
parent93009d0246a19b6500afd52da4023debe1e8c99d (diff)
BST basic unit test works
Diffstat (limited to 'set/set_test.go')
-rw-r--r--set/set_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/set/set_test.go b/set/set_test.go
index 16d3e8c..cd44e24 100644
--- a/set/set_test.go
+++ b/set/set_test.go
@@ -11,17 +11,25 @@ const factor int = 10
const minLength int = 1
const maxLength int = 10
-func TestSet(t *testing.T) {
+func TestElementary(t *testing.T) {
s := NewElementary()
for i := minLength; i <= maxLength; i *= factor {
test(s, i, t)
}
}
+func TestBST(t *testing.T) {
+ s := NewBST()
+ for i := minLength; i <= maxLength; i *= factor {
+ test(s, i, t)
+ }
+}
+
func test(s Set, l int, t *testing.T) {
cb := func(t *testing.T) {
list := ds.NewRandomArrayList(l, -1)
for i, a := range list {
+ t.Log("Inserting", a, i, s)
s.Set(a, i)
}
for i, a := range list {