Skip to content
Snippets Groups Projects
shortid_test.go 318 B
Newer Older
  • Learn to ignore specific revisions
  • package errors_test
    
    import (
    	"testing"
    
    	"github.com/stretchr/testify/assert"
    
    	"code.vereign.com/gaiax/tsa/golib/errors"
    )
    
    func TestNewID(t *testing.T) {
    	for i := 0; i < 100; i++ {
    		id := errors.NewID()
    		assert.Len(t, id, 16)
    
    		for _, r := range id {
    			assert.Contains(t, errors.Alphabet, string(r))
    		}
    	}
    }