forked from timtadh/data-structures
/
cast_test.go
49 lines (41 loc) · 1.14 KB
/
cast_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package data_structures
import "testing"
import (
"github.com/timtadh/data-structures/types"
"github.com/timtadh/data-structures/tree/avl"
"github.com/timtadh/data-structures/tree/bptree"
"github.com/timtadh/data-structures/trie"
"github.com/timtadh/data-structures/hashtable"
)
func TestAvlTreeCast(t *testing.T) {
tree := avl.NewAvlTree()
_ = types.TreeMap(tree)
}
func TestImmutableAvlTreeCast(t *testing.T) {
tree := avl.NewImmutableAvlTree()
_ = types.TreeMap(tree)
}
func TestHashtableCast(t *testing.T) {
hash := hashtable.NewHashTable(16)
_ = types.Sized(hash)
_ = types.MapIterable(hash)
_ = types.MapOperable(hash)
_ = types.Map(hash)
}
func TestLinearHashtableCast(t *testing.T) {
hash := hashtable.NewLinearHash()
_ = types.Sized(hash)
_ = types.MapIterable(hash)
_ = types.MapOperable(hash)
_ = types.Map(hash)
}
func TestTSTCast(t *testing.T) {
tst := new(trie.TST)
_ = types.MapIterable(tst)
}
func TestBpTreeCast(t *testing.T) {
bpt := bptree.NewBpTree(17)
_ = types.MapIterable(bpt)
_ = types.MultiMapOperable(bpt)
_ = types.MultiMap(bpt)
}