MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / equals

Function equals

IceFireDB-Redis-Proxy/test/test_test.go:37–57  ·  view source on GitHub ↗

equals fails the test if exp is not equal to act.

(tb testing.TB, exp, act interface{})

Source from the content-addressed store, hash-verified

35
36// equals fails the test if exp is not equal to act.
37func equals(tb testing.TB, exp, act interface{}) {
38 tb.Helper()
39 if exp, oke := exp.(string); oke {
40 if act, ok := act.(string); ok {
41 eq := strings.EqualFold(exp, act)
42 if !eq {
43 tb.Errorf("expected: %#v got: %#v", exp, act)
44 }
45 return
46 }
47 }
48 /*if _, ok := exp.([]string); ok {
49 sort.Strings(exp.([]string))
50 }
51 if _, ok := act.([]string); ok {
52 sort.Strings(act.([]string))
53 }*/
54 if !reflect.DeepEqual(exp, act) {
55 tb.Errorf("expected: %#v got: %#v", exp, act)
56 }
57}
58
59func equalStr(tb testing.TB, want, have string) {
60 tb.Helper()

Callers 15

TestSaddFunction · 0.70
TestSismemberFunction · 0.70
TestSremFunction · 0.70
TestSortedSetFunction · 0.70
TestSortedSetRemFunction · 0.70
TestSortedSetScoreFunction · 0.70
TestLpushFunction · 0.70
TestLpushxFunction · 0.70
TestRPushPopFunction · 0.70
TestLtrimFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected