(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestMatch_Alias(t *testing.T) { |
| 80 | reporter := newMockReporter(t) |
| 81 | |
| 82 | matches := []string{"m0", "m1", "m2"} |
| 83 | names := []string{"", "n1", "n2"} |
| 84 | |
| 85 | value := NewMatch(reporter, matches, names) |
| 86 | assert.Equal(t, []string{"Match()"}, value.chain.context.Path) |
| 87 | assert.Equal(t, []string{"Match()"}, value.chain.context.AliasedPath) |
| 88 | |
| 89 | value.Alias("foo") |
| 90 | assert.Equal(t, []string{"Match()"}, value.chain.context.Path) |
| 91 | assert.Equal(t, []string{"foo"}, value.chain.context.AliasedPath) |
| 92 | |
| 93 | childValue := value.Submatch(0) |
| 94 | assert.Equal(t, []string{"Match()", "Submatch(0)"}, childValue.chain.context.Path) |
| 95 | assert.Equal(t, []string{"foo", "Submatch(0)"}, childValue.chain.context.AliasedPath) |
| 96 | } |
| 97 | |
| 98 | func TestMatch_Getters(t *testing.T) { |
| 99 | matches := []string{"m0", "m1", "m2"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…