summaryrefslogtreecommitdiff
path: root/pkg/bst/bst_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-05-27 13:26:12 +0300
committerValery Piashchynski <[email protected]>2021-05-27 13:26:12 +0300
commit0a9aea326045e56716f0736f7aa8520305362c51 (patch)
tree532ca326690d81e97136248dd798d23a56843278 /pkg/bst/bst_test.go
parent57a30c2b49c36161b3af3e539a8618c2d39a5cc9 (diff)
- Move bst to the pkg folder
- Add comments - Fix all golangci-lint warnings Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/bst/bst_test.go')
-rw-r--r--pkg/bst/bst_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkg/bst/bst_test.go b/pkg/bst/bst_test.go
new file mode 100644
index 00000000..e8a13760
--- /dev/null
+++ b/pkg/bst/bst_test.go
@@ -0,0 +1,37 @@
+package bst
+
+import (
+ "testing"
+
+ "github.com/google/uuid"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestNewBST(t *testing.T) {
+ // create a new bst
+ 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")
+ }
+
+ // should be 100
+ exist := g.Get("comments")
+ assert.Len(t, exist, 100)
+
+ // should be 100
+ exist2 := g.Get("comments2")
+ assert.Len(t, exist2, 100)
+
+ // should be 100
+ exist3 := g.Get("comments3")
+ assert.Len(t, exist3, 100)
+}