(t *testing.T)
| 82 | assert.Contains(t, err.Error(), PortCtrl) |
| 83 | }) |
| 84 | } |
| 85 | |
| 86 | func TestBranchingNode(t *testing.T) { |
| 87 | t.Run("AddTransition accumulates multiple targets per port", func(t *testing.T) { |
| 88 | n := NewBranchingNode("b") |
| 89 | require.NoError(t, n.AddTransition(PortCtrl, Transition{TargetID: "a"})) |
| 90 | require.NoError(t, n.AddTransition(PortCtrl, Transition{TargetID: "b"})) |
| 91 | |
| 92 | brs := n.Transitions(PortCtrl) |
| 93 | require.Len(t, brs, 2) |
| 94 | assert.Equal(t, "a", brs[0].TargetID) |
| 95 | assert.Equal(t, "b", brs[1].TargetID) |
| 96 | }) |
| 97 | |
| 98 | t.Run("Transitions on unknown port returns nil", func(t *testing.T) { |
| 99 | n := NewBranchingNode("b") |
| 100 | assert.Empty(t, n.Transitions("nope")) |
| 101 | }) |
| 102 | |
| 103 | t.Run("ID returns the configured id", func(t *testing.T) { |
| 104 | n := NewBranchingNode("xyz") |
| 105 | assert.Equal(t, "xyz", n.ID()) |
| 106 | }) |
| 107 | } |
| 108 |
nothing calls this directly
no test coverage detected