| 240 | } |
| 241 | |
| 242 | func TestArray_Path(t *testing.T) { |
| 243 | cases := []struct { |
| 244 | name string |
| 245 | value []interface{} |
| 246 | }{ |
| 247 | { |
| 248 | name: "empty", |
| 249 | value: []interface{}{}, |
| 250 | }, |
| 251 | { |
| 252 | name: "not empty", |
| 253 | value: []interface{}{"foo", 123.0}, |
| 254 | }, |
| 255 | } |
| 256 | |
| 257 | for _, tc := range cases { |
| 258 | t.Run(tc.name, func(t *testing.T) { |
| 259 | reporter := newMockReporter(t) |
| 260 | |
| 261 | value := NewArray(reporter, tc.value) |
| 262 | |
| 263 | assert.Equal(t, tc.value, value.Path("$").Raw()) |
| 264 | value.chain.assert(t, success) |
| 265 | }) |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | func TestArray_Schema(t *testing.T) { |
| 270 | cases := []struct { |