github.com/vmware/govmomi@v0.51.0/simulator/container_test.go (about) 1 // © Broadcom. All Rights Reserved. 2 // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 // SPDX-License-Identifier: Apache-2.0 4 5 package simulator 6 7 import ( 8 "testing" 9 10 "github.com/google/uuid" 11 ) 12 13 func TestEncodeDMI(t *testing.T) { 14 id := uuid.Must(uuid.Parse("423e36c8-723d-2b24-8590-0eb1d9180aa2")) 15 16 tests := []struct { 17 f func(uuid.UUID) string 18 expect string 19 }{ 20 {productSerial, "VMware-42 3e 36 c8 72 3d 2b 24-85 90 0e b1 d9 18 0a a2"}, 21 {productUUID, "C8363E42-3D72-242B-8590-0EB1D9180AA2"}, 22 } 23 24 for _, test := range tests { 25 val := test.f(id) 26 if val != test.expect { 27 t.Errorf("%q != %q", val, test.expect) 28 } 29 } 30 }