diff options
Diffstat (limited to 'plugins/broadcast/memory/bst/bst_test.go')
-rw-r--r-- | plugins/broadcast/memory/bst/bst_test.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/broadcast/memory/bst/bst_test.go b/plugins/broadcast/memory/bst/bst_test.go new file mode 100644 index 00000000..b5ad6c10 --- /dev/null +++ b/plugins/broadcast/memory/bst/bst_test.go @@ -0,0 +1,33 @@ +package bst + +import ( + "testing" + + "github.com/google/uuid" + "github.com/stretchr/testify/assert" +) + +func TestNewBST(t *testing.T) { + g := NewBST() + + for i := 0; i < 100; i++ { + g.Insert(uuid.NewString(), "comments") + } + + for i := 0; i < 100; i++ { + g.Insert(uuid.NewString(), "comments2") + } + + for i := 0; i < 100; i++ { + g.Insert(uuid.NewString(), "comments3") + } + + exist := g.Get("comments") + assert.Len(t, exist, 100) + + exist2 := g.Get("comments2") + assert.Len(t, exist2, 100) + + exist3 := g.Get("comments3") + assert.Len(t, exist3, 100) +} |