mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 00:32:09 -04:00
The dag package is a port over from Terraform to Packer, changing what little there was to fit our current dependency ecosystem. Most of the changes are on the type of diagnostics returned, as Terraform has its own type for them, while we rely on hcl's Diagnostics. Other than that, the functionality is essentially equivalent, and the code was barely touched.
29 lines
495 B
Go
29 lines
495 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package dag
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestBasicEdgeHashcode(t *testing.T) {
|
|
e1 := BasicEdge(1, 2)
|
|
e2 := BasicEdge(1, 2)
|
|
if e1.Hashcode() != e2.Hashcode() {
|
|
t.Fatalf("bad")
|
|
}
|
|
}
|
|
|
|
func TestBasicEdgeHashcode_pointer(t *testing.T) {
|
|
type test struct {
|
|
Value string
|
|
}
|
|
|
|
v1, v2 := &test{"foo"}, &test{"bar"}
|
|
e1 := BasicEdge(v1, v2)
|
|
e2 := BasicEdge(v1, v2)
|
|
if e1.Hashcode() != e2.Hashcode() {
|
|
t.Fatalf("bad")
|
|
}
|
|
}
|