github.com/magodo/terraform@v0.11.12-beta1/dag/edge_test.go (about)

     1  package dag
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestBasicEdgeHashcode(t *testing.T) {
     8  	e1 := BasicEdge(1, 2)
     9  	e2 := BasicEdge(1, 2)
    10  	if e1.Hashcode() != e2.Hashcode() {
    11  		t.Fatalf("bad")
    12  	}
    13  }
    14  
    15  func TestBasicEdgeHashcode_pointer(t *testing.T) {
    16  	type test struct {
    17  		Value string
    18  	}
    19  
    20  	v1, v2 := &test{"foo"}, &test{"bar"}
    21  	e1 := BasicEdge(v1, v2)
    22  	e2 := BasicEdge(v1, v2)
    23  	if e1.Hashcode() != e2.Hashcode() {
    24  		t.Fatalf("bad")
    25  	}
    26  }