Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

70
pkg/redis/set_test.go Normal file
View File

@@ -0,0 +1,70 @@
package redis
import (
"testing"
"fiskerinc.com/modules/testhelper"
)
func TestInitSet(t *testing.T) {
s := make(Set)
numS := 0
if len(s) != numS {
t.Errorf(testhelper.TestErrorTemplate, "TestInitSet", numS, len(s))
}
}
func TestSetAdd(t *testing.T) {
s := make(Set)
if ok := s.Add("TESTVIN123"); !ok {
t.Errorf(testhelper.TestErrorTemplate, "TestSetAdd", true, ok)
}
numS := 1
if len(s) != numS {
t.Errorf(testhelper.TestErrorTemplate, "TestInitSet", numS, len(s))
}
}
func TestSetAddError(t *testing.T) {
s := make(Set)
s.Add("TESTVIN123")
if ok := s.Add("TESTVIN123"); ok {
t.Errorf(testhelper.TestErrorTemplate, "TestSetAddError", false, ok)
}
numS := 1
if len(s) != numS {
t.Errorf(testhelper.TestErrorTemplate, "TestInitSet", numS, len(s))
}
}
func TestSetRemove(t *testing.T) {
s := make(Set)
s.Add("TESTVIN123")
if ok := s.Remove("TESTVIN123"); !ok {
t.Errorf(testhelper.TestErrorTemplate, "TestSetRemove", true, ok)
}
numS := 0
if len(s) != numS {
t.Errorf(testhelper.TestErrorTemplate, "TestSetRemove", numS, len(s))
}
}
func TestSetRemoveError(t *testing.T) {
s := make(Set)
if ok := s.Remove("TESTVIN123"); ok {
t.Errorf(testhelper.TestErrorTemplate, "TestSetRemove", false, ok)
}
numS := 0
if len(s) != numS {
t.Errorf(testhelper.TestErrorTemplate, "TestSetRemove", numS, len(s))
}
}