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

Function testHashArray

hashes_test.go:74–91  ·  view source on GitHub ↗
(ay []interface{}, checkValues ...int)

Source from the content-addressed store, hash-verified

72}
73
74func testHashArray(ay []interface{}, checkValues ...int) error {
75 if len(ay) != len(checkValues) {
76 return fmt.Errorf("invalid return number %d != %d", len(ay), len(checkValues))
77 }
78
79 for i := 0; i < len(ay); i++ {
80 if ay[i] == nil && checkValues[i] != 0 {
81 return fmt.Errorf("must nil")
82 } else if ay[i] != nil {
83 d := cast.ToInt(ay[i])
84
85 if d != checkValues[i] {
86 return fmt.Errorf("invalid data %d %v != %d", i, d, checkValues[i])
87 }
88 }
89 }
90 return nil
91}
92
93func TestHashM(t *testing.T) {
94 c := getTestConn()

Callers 2

TestHashMFunction · 0.85
TestHashGetAllFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected