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