From 7a75bc5f0b9001c6515080ea049de8031ff4f6c8 Mon Sep 17 00:00:00 2001 From: Devansh Singh Date: Sun, 18 Feb 2024 18:55:53 +0530 Subject: [PATCH] Minor updates Signed-off-by: Devansh Singh --- set/set_test.go | 6 +++--- zset/rbtree_test.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/set/set_test.go b/set/set_test.go index fbd4ea0..820cf99 100644 --- a/set/set_test.go +++ b/set/set_test.go @@ -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() @@ -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) diff --git a/zset/rbtree_test.go b/zset/rbtree_test.go index de3f2e6..cd6117e 100644 --- a/zset/rbtree_test.go +++ b/zset/rbtree_test.go @@ -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() @@ -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) } @@ -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) } @@ -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)