| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package extensions // import "go.opentelemetry.io/collector/service/extensions" |
| 5 |
|
| 6 |
import ( |
| 7 |
"errors" |
| 8 |
"testing" |
| 9 |
|
| 10 |
"github.com/stretchr/testify/assert" |
| 11 |
"gonum.org/v1/gonum/graph" |
| 12 |
"gonum.org/v1/gonum/graph/topo" |
| 13 |
) |
| 14 |
|
| 15 |
func TestCycleErr(t *testing.T) { |
| 16 |
err := errors.New("foo") |
| 17 |
assert.Equal(t, err, cycleErr(err, nil), "cycleErr should return the error unchanged when it's unrecognized") |
| 18 |
|
| 19 |
var topoErr topo.Unorderable = [][]graph.Node{{}} |
| 20 |
assert.Equal(t, topoErr, cycleErr(topoErr, nil), "cycleErr should return topo.Unorderable error unchanged when no cycles are found") |
| 21 |
} |