MCPcopy
hub / github.com/redis/go-redis / TestVAdd

Function TestVAdd

vectorset_commands_test.go:86–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestVAdd(t *testing.T) {
87 m := &mockCmdable{}
88 c := m.asCmdable()
89 vec := &VectorValues{Val: []float64{1, 2}}
90 c.VAdd(context.Background(), "k", "e", vec)
91 cmd, ok := m.lastCmd.(*BoolCmd)
92 if !ok {
93 t.Fatalf("expected BoolCmd, got %T", m.lastCmd)
94 }
95 if cmd.args[0] != "vadd" || cmd.args[1] != "k" || cmd.args[len(cmd.args)-1] != "e" {
96 t.Errorf("unexpected args: %v", cmd.args)
97 }
98}
99
100func TestVAddWithArgs_AllOptions(t *testing.T) {
101 m := &mockCmdable{}

Callers

nothing calls this directly

Calls 2

asCmdableMethod · 0.95
VAddMethod · 0.65

Tested by

no test coverage detected