(ay []interface{}, checkValues ...int)
| 72 | } |
| 73 | |
| 74 | func 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 | |
| 93 | func TestHashM(t *testing.T) { |
| 94 | c := getTestConn() |
no outgoing calls
no test coverage detected