...

Source file src/go.einride.tech/aip/resourceid/systemgenerated_test.go

Documentation: go.einride.tech/aip/resourceid

     1  package resourceid
     2  
     3  import (
     4  	"regexp"
     5  	"testing"
     6  
     7  	"gotest.tools/v3/assert"
     8  	"gotest.tools/v3/assert/cmp"
     9  )
    10  
    11  func TestNewSystemGenerated(t *testing.T) {
    12  	t.Parallel()
    13  	const uuidV4Regexp = `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`
    14  	assert.Assert(t, cmp.Regexp(regexp.MustCompile(uuidV4Regexp), NewSystemGenerated()))
    15  }
    16  
    17  func TestNewSystemGeneratedBase32(t *testing.T) {
    18  	t.Parallel()
    19  	const base32Regexp = `^[a-z2-7]{26}$`
    20  	assert.Assert(t, cmp.Regexp(regexp.MustCompile(base32Regexp), NewSystemGeneratedBase32()))
    21  }
    22  

View as plain text