go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/core/resources/uuid_test.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package resources_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"go.mondoo.com/cnquery/providers-sdk/v1/testutils"
    10  )
    11  
    12  func TestUUID(t *testing.T) {
    13  	x.TestSimple(t, []testutils.SimpleTest{
    14  		{
    15  			Code:        "uuid('6ba7b810-9dad-11d1-80b4-00c04fd430c8').value",
    16  			ResultIndex: 0,
    17  			Expectation: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    18  		},
    19  		{
    20  			Code:        "uuid('6ba7b810-9dad-11d1-80b4-00c04fd430c8').variant",
    21  			ResultIndex: 0,
    22  			Expectation: "RFC4122",
    23  		},
    24  		{
    25  			Code:        "uuid('6ba7b810-9dad-11d1-80b4-00c04fd430c8').version",
    26  			ResultIndex: 0,
    27  			Expectation: int64(1),
    28  		},
    29  	})
    30  }