open-nomad/nomad/structs/workload_id_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
517 B
Go
Raw Normal View History

package structs
import (
"testing"
"github.com/hashicorp/nomad/ci"
"github.com/shoenig/test/must"
)
func TestWorkloadIdentity_Equal(t *testing.T) {
ci.Parallel(t)
var orig *WorkloadIdentity
newWI := orig.Copy()
must.Equal(t, orig, newWI)
orig = &WorkloadIdentity{}
must.NotEqual(t, orig, newWI)
newWI = &WorkloadIdentity{}
must.Equal(t, orig, newWI)
orig.Env = true
must.NotEqual(t, orig, newWI)
newWI.Env = true
must.Equal(t, orig, newWI)
newWI.File = true
must.NotEqual(t, orig, newWI)
}