MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / TestGETSET

Function TestGETSET

strings_test.go:49–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestGETSET(t *testing.T) {
50 c := newClient(t)
51 oldValue, err := c.GETSET("hello", StringValue{"world"})
52 assert.NoError(t, err)
53 assert.False(t, oldValue.Present())
54 assert.True(t, oldValue.Empty())
55
56 oldValue, err = c.GETSET("hello", StringValue{"mundo"})
57 assert.NoError(t, err)
58 assert.Equal(t, "world", oldValue.String())
59
60 val, _ := c.GET("hello")
61 assert.Equal(t, "mundo", val.String())
62}
63
64func TestCounters(t *testing.T) {
65 c := newClient(t)

Callers

nothing calls this directly

Calls 6

newClientFunction · 0.85
GETSETMethod · 0.80
PresentMethod · 0.80
EmptyMethod · 0.80
GETMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected