github.com/hashicorp/packer@v1.14.3/internal/dag/edge_test.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package dag 5 6 import ( 7 "testing" 8 ) 9 10 func TestBasicEdgeHashcode(t *testing.T) { 11 e1 := BasicEdge(1, 2) 12 e2 := BasicEdge(1, 2) 13 if e1.Hashcode() != e2.Hashcode() { 14 t.Fatalf("bad") 15 } 16 } 17 18 func TestBasicEdgeHashcode_pointer(t *testing.T) { 19 type test struct { 20 Value string 21 } 22 23 v1, v2 := &test{"foo"}, &test{"bar"} 24 e1 := BasicEdge(v1, v2) 25 e2 := BasicEdge(v1, v2) 26 if e1.Hashcode() != e2.Hashcode() { 27 t.Fatalf("bad") 28 } 29 }