mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Remove loop from TestWalker_removeVertex
There's no timing dependent behavior here, since V1 must be visited before V2, Remove and Update must be called before V2 is visited.
This commit is contained in:
parent
0fb24c1a7a
commit
7bf33c2a7f
@ -106,9 +106,7 @@ func TestWalker_newVertex(t *testing.T) {
|
|||||||
var w *Walker
|
var w *Walker
|
||||||
cb := func(v Vertex) error {
|
cb := func(v Vertex) error {
|
||||||
if v == 2 {
|
if v == 2 {
|
||||||
defer func() {
|
defer close(done2)
|
||||||
close(done2)
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
return recordF(v)
|
return recordF(v)
|
||||||
}
|
}
|
||||||
@ -141,8 +139,6 @@ func TestWalker_newVertex(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestWalker_removeVertex(t *testing.T) {
|
func TestWalker_removeVertex(t *testing.T) {
|
||||||
// Run it a bunch of times since it is timing dependent
|
|
||||||
for i := 0; i < 50; i++ {
|
|
||||||
var g AcyclicGraph
|
var g AcyclicGraph
|
||||||
g.Add(1)
|
g.Add(1)
|
||||||
g.Add(2)
|
g.Add(2)
|
||||||
@ -152,7 +148,6 @@ func TestWalker_removeVertex(t *testing.T) {
|
|||||||
var order []interface{}
|
var order []interface{}
|
||||||
recordF := walkCbRecord(&order)
|
recordF := walkCbRecord(&order)
|
||||||
|
|
||||||
// Build a callback that delays until we close a channel
|
|
||||||
var w *Walker
|
var w *Walker
|
||||||
cb := func(v Vertex) error {
|
cb := func(v Vertex) error {
|
||||||
if v == 1 {
|
if v == 1 {
|
||||||
@ -177,7 +172,6 @@ func TestWalker_removeVertex(t *testing.T) {
|
|||||||
if !reflect.DeepEqual(order, expected) {
|
if !reflect.DeepEqual(order, expected) {
|
||||||
t.Fatalf("bad: %#v", order)
|
t.Fatalf("bad: %#v", order)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWalker_newEdge(t *testing.T) {
|
func TestWalker_newEdge(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user