github.com/argoproj/argo-cd@v1.8.7/util/rand/rand_test.go (about)

     1  package rand
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestRandString(t *testing.T) {
     8  	ss := RandStringCharset(10, "A")
     9  	if ss != "AAAAAAAAAA" {
    10  		t.Errorf("Expected 10 As, but got %q", ss)
    11  	}
    12  	ss = RandStringCharset(5, "ABC123")
    13  	if len(ss) != 5 {
    14  		t.Errorf("Expected random string of length 10, but got %q", ss)
    15  	}
    16  }