(t *testing.T)
| 518 | } |
| 519 | |
| 520 | func TestChain_Root(t *testing.T) { |
| 521 | t.Run("newChainWithConfig, non-empty path", func(t *testing.T) { |
| 522 | chain := newChainWithConfig("root", Config{ |
| 523 | AssertionHandler: &mockAssertionHandler{}, |
| 524 | }.withDefaults()) |
| 525 | |
| 526 | assert.Equal(t, []string{"root"}, chain.context.Path) |
| 527 | }) |
| 528 | |
| 529 | t.Run("newChainWithConfig, empty path", func(t *testing.T) { |
| 530 | chain := newChainWithConfig("", Config{ |
| 531 | AssertionHandler: &mockAssertionHandler{}, |
| 532 | }.withDefaults()) |
| 533 | |
| 534 | assert.Equal(t, []string{}, chain.context.Path) |
| 535 | }) |
| 536 | |
| 537 | t.Run("newChainWithDefaults, non-empty path", func(t *testing.T) { |
| 538 | chain := newChainWithDefaults("root", newMockReporter(t)) |
| 539 | |
| 540 | assert.Equal(t, []string{"root"}, chain.context.Path) |
| 541 | }) |
| 542 | |
| 543 | t.Run("newChainWithDefaults, empty path", func(t *testing.T) { |
| 544 | chain := newChainWithDefaults("", newMockReporter(t)) |
| 545 | |
| 546 | assert.Equal(t, []string{}, chain.context.Path) |
| 547 | }) |
| 548 | } |
| 549 | |
| 550 | func TestChain_Path(t *testing.T) { |
| 551 | path := func(c *chain) string { |
nothing calls this directly
no test coverage detected
searching dependent graphs…