(t *testing.T)
| 222 | } |
| 223 | |
| 224 | func TestArray_Alias(t *testing.T) { |
| 225 | reporter := newMockReporter(t) |
| 226 | |
| 227 | value := NewArray(reporter, []interface{}{1, 2}) |
| 228 | assert.Equal(t, []string{"Array()"}, value.chain.context.Path) |
| 229 | assert.Equal(t, []string{"Array()"}, value.chain.context.AliasedPath) |
| 230 | |
| 231 | value.Alias("foo") |
| 232 | assert.Equal(t, []string{"Array()"}, value.chain.context.Path) |
| 233 | assert.Equal(t, []string{"foo"}, value.chain.context.AliasedPath) |
| 234 | |
| 235 | childValue := value.Filter(func(index int, value *Value) bool { |
| 236 | return value.Number().Raw() > 1 |
| 237 | }) |
| 238 | assert.Equal(t, []string{"Array()", "Filter()"}, childValue.chain.context.Path) |
| 239 | assert.Equal(t, []string{"foo", "Filter()"}, childValue.chain.context.AliasedPath) |
| 240 | } |
| 241 | |
| 242 | func TestArray_Path(t *testing.T) { |
| 243 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…