github.com/hernad/nomad@v1.6.112/nomad/structs/workload_id_test.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package structs 5 6 import ( 7 "testing" 8 9 "github.com/hernad/nomad/ci" 10 "github.com/shoenig/test/must" 11 ) 12 13 func TestWorkloadIdentity_Equal(t *testing.T) { 14 ci.Parallel(t) 15 16 var orig *WorkloadIdentity 17 18 newWI := orig.Copy() 19 must.Equal(t, orig, newWI) 20 21 orig = &WorkloadIdentity{} 22 must.NotEqual(t, orig, newWI) 23 24 newWI = &WorkloadIdentity{} 25 must.Equal(t, orig, newWI) 26 27 orig.Env = true 28 must.NotEqual(t, orig, newWI) 29 30 newWI.Env = true 31 must.Equal(t, orig, newWI) 32 33 newWI.File = true 34 must.NotEqual(t, orig, newWI) 35 }