Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
Signed-off-by: Devansh Singh <[email protected]>
  • Loading branch information
Devansh3712 committed Feb 18, 2024
1 parent a504921 commit 7a75bc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions set/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package set

import "testing"

var members = []string{"hello", "world", "how", "are", "you"}
var members = []string{"hello", "secctan", "how", "are", "you"}

func createTestSet() Set {
set := NewSet()
Expand All @@ -25,13 +25,13 @@ func TestSize(t *testing.T) {
func TestExists(t *testing.T) {
set := createTestSet()

got := set.Exists("hello")
got := set.Exists("secctan")
want := true
if got != want {
t.Errorf("got %t, wanted %t", got, want)
}

got = set.Exists("secctan")
got = set.Exists("world")
want = false
if got != want {
t.Errorf("got %t, wanted %t", got, want)
Expand Down
10 changes: 5 additions & 5 deletions zset/rbtree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
)

var members = []string{"hello", "world", "how", "are", "you"}
var members = []string{"hello", "secctan", "how", "are", "you"}

func createTestTree() *RBTree {
tree := NewRBTree()
Expand All @@ -19,7 +19,7 @@ func TestInsert(t *testing.T) {
tree := createTestTree()

got := tree.members()
want := []string{"are", "hello", "how", "world", "you"}
want := []string{"are", "hello", "how", "secctan", "you"}
if !reflect.DeepEqual(got, want) {
t.Errorf("got %q, wanted %q", got, want)
}
Expand All @@ -30,7 +30,7 @@ func TestDelete(t *testing.T) {
tree.delete("hello")

got := tree.members()
want := []string{"are", "how", "world", "you"}
want := []string{"are", "how", "secctan", "you"}
if !reflect.DeepEqual(got, want) {
t.Errorf("got %q, wanted %q", got, want)
}
Expand All @@ -39,13 +39,13 @@ func TestDelete(t *testing.T) {
func TestSearch(t *testing.T) {
tree := createTestTree()

_, got := tree.search("hello")
_, got := tree.search("secctan")
want := true
if got != want {
t.Errorf("got %t, wanted %t", got, want)
}

_, got = tree.search("secctan")
_, got = tree.search("world")
want = false
if got != want {
t.Errorf("got %t, wanted %t", got, want)
Expand Down

0 comments on commit 7a75bc5

Please sign in to comment.