summaryrefslogtreecommitdiff
path: root/plugins/broadcast/memory/bst/bst_test.go
blob: b5ad6c10de3b9b1572d6acab322ec487c8e3d556 (plain)
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
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)
}