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

Function TestHashSetNX

IceFireDB-PubSub/test/cmd_hash_test.go:116–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestHashSetNX(t *testing.T) {
117 server.Clear()
118
119 c, err := proto.Dial(server.Addr())
120 ok(t, err)
121 defer c.Close()
122
123 // New Hash
124 must1(t, c, "HSETNX", "wim", "zusnx", "jet")
125
126 must0(t, c, "HSETNX", "wim", "zusnx", "jet")
127
128 // Just a new key
129 must1(t, c, "HSETNX", "wim", "aapnx", "noot")
130
131 // Wrong key type
132 directDoString(t, c, "SET", "foo", "bar")
133 mustDo(t, c,
134 "HSETNX", "foo", "nosuch", "nosuch",
135 proto.Error("WRONGTYPE Operation against a key holding the wrong kind of value"),
136 )
137}
138
139func TestHashMSet(t *testing.T) {
140 server.Clear()

Callers

nothing calls this directly

Calls 10

ClearFunction · 0.92
DialFunction · 0.92
AddrFunction · 0.92
ErrorFunction · 0.92
okFunction · 0.70
must1Function · 0.70
must0Function · 0.70
directDoStringFunction · 0.70
mustDoFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected