MCPcopy
hub / github.com/olric-data/olric / TestProtocol_ParsePutCommand_EXAT

Function TestProtocol_ParsePutCommand_EXAT

internal/protocol/dmap_test.go:101–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestProtocol_ParsePutCommand_EXAT(t *testing.T) {
102 putCmd := NewPut("my-dmap", "my-key", []byte("my-value"))
103 exat := float64(time.Now().Unix()) + 10
104 putCmd.SetEXAT(exat)
105
106 cmd := stringToCommand(putCmd.Command(context.Background()).String())
107 parsed, err := ParsePutCommand(cmd)
108 require.NoError(t, err)
109
110 require.Equal(t, "my-dmap", parsed.DMap)
111 require.Equal(t, "my-key", parsed.Key)
112 require.Equal(t, []byte("my-value"), parsed.Value)
113 require.Equal(t, exat, parsed.EXAT)
114}
115
116func TestProtocol_ParsePutCommand_PXAT(t *testing.T) {
117 putCmd := NewPut("my-dmap", "my-key", []byte("my-value"))

Callers

nothing calls this directly

Calls 6

SetEXATMethod · 0.95
CommandMethod · 0.95
NewPutFunction · 0.85
stringToCommandFunction · 0.85
ParsePutCommandFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected