diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-02-10 11:38:05 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-02-10 14:34:44 +0100 |
| commit | 50b2f41ed948a2a47420d8edc9abca2d477eccfb (patch) | |
| tree | adcef18a7dd0188e32dbf8ef4dad9d5b72f15dde /pkg/subsystem/linux/parents_test.go | |
| parent | 0241baba08ba2fd732e46a9634434154d58092e3 (diff) | |
pkg/subsystem: detect loops on the go
This lets us reduce the amount of code in parents.go.
Diffstat (limited to 'pkg/subsystem/linux/parents_test.go')
| -rw-r--r-- | pkg/subsystem/linux/parents_test.go | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/pkg/subsystem/linux/parents_test.go b/pkg/subsystem/linux/parents_test.go index f1942671d..dde13177d 100644 --- a/pkg/subsystem/linux/parents_test.go +++ b/pkg/subsystem/linux/parents_test.go @@ -69,21 +69,6 @@ func TestDropDuplicateSubsystems(t *testing.T) { assert.ElementsMatch(t, ret, expected) } -func TestLoopsDoExist(t *testing.T) { - a := &entity.Subsystem{} - b := &entity.Subsystem{Parents: []*entity.Subsystem{a}} - c := &entity.Subsystem{Parents: []*entity.Subsystem{b}} - a.Parents = []*entity.Subsystem{c} - assert.True(t, loopsExist([]*entity.Subsystem{a, b, c})) -} - -func TestLoopsDoNotExist(t *testing.T) { - a := &entity.Subsystem{} - b := &entity.Subsystem{Parents: []*entity.Subsystem{a}} - c := &entity.Subsystem{Parents: []*entity.Subsystem{b}} - assert.False(t, loopsExist([]*entity.Subsystem{a, b, c})) -} - func TestTransitiveReduction(t *testing.T) { // (d, c), (c, b), (b, a) // (d, a) |
