MCPcopy Create free account
hub / github.com/evilsocket/sum / TestWrappedRecordCosineWithNull

Function TestWrappedRecordCosineWithNull

wrapper/record_test.go:144–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

142}
143
144func TestWrappedRecordCosineWithNull(t *testing.T) {
145 assertPanic(t, "cosine similarity should panic with null wrapped record", func() {
146 WrapRecord(nil).Cosine(WrapRecord(nil))
147 })
148
149 assertPanic(t, "cosine similarity should panic with null wrapped record", func() {
150 WrapRecord(&testRecord).Cosine(WrapRecord(nil))
151 })
152
153 assertPanic(t, "cosine similarity should panic with null wrapped record", func() {
154 WrapRecord(nil).Cosine(WrapRecord(&testRecord))
155 })
156}
157
158func TestWrappedRecordCosineWithIncompatibleSizes(t *testing.T) {
159 assertPanic(t, "cosine similarity should panic with vectors of different sizes", func() {

Callers

nothing calls this directly

Calls 3

assertPanicFunction · 0.85
WrapRecordFunction · 0.85
CosineMethod · 0.80

Tested by

no test coverage detected