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

Function TestAppend

IceFireDB-Redis-Proxy/test/cmd_string_test.go:922–968  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

920}
921
922func TestAppend(t *testing.T) {
923 server.Clear()
924 c, err := proto.Dial(server.Addr())
925 ok(t, err)
926 defer c.Close()
927 s := server.Direct()
928
929 // Existing key
930 {
931 s.Set("foo", "bar!")
932 mustDo(t, c,
933 "APPEND", "foo", "morebar",
934 proto.Int(11),
935 )
936 }
937
938 // New key
939 mustDo(t, c,
940 "APPEND", "bar", "was empty",
941 proto.Int(9),
942 )
943
944 // Wrong type of existing key
945 {
946 s.HSet("wrong", "aap", "noot")
947 mustDo(t, c,
948 "APPEND", "wrong", "type",
949 proto.Error(msgWrongType),
950 )
951 }
952
953 // Wrong usage
954 {
955 mustDo(t, c,
956 "APPEND",
957 proto.Error(errWrongNumber("append")),
958 )
959 mustDo(t, c,
960 "APPEND", "missing",
961 proto.Error(errWrongNumber("append")),
962 )
963 mustDo(t, c,
964 "APPEND", "spurious", "arguments", "!",
965 proto.Error(errWrongNumber("append")),
966 )
967 }
968}
969
970func TestGetrange(t *testing.T) {
971 server.Clear()

Callers

nothing calls this directly

Calls 11

ClearFunction · 0.92
DialFunction · 0.92
AddrFunction · 0.92
DirectFunction · 0.92
IntFunction · 0.92
ErrorFunction · 0.92
SetMethod · 0.80
okFunction · 0.70
mustDoFunction · 0.70
errWrongNumberFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected