github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/random/random_test.go (about)

     1  package random
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  const (
     8  	// testLength is the length used for testing random data generation.
     9  	testLength = 64
    10  )
    11  
    12  // TestNew tests New.
    13  func TestNew(t *testing.T) {
    14  	if data, err := New(testLength); err != nil {
    15  		t.Fatal("unable to create random data:", err)
    16  	} else if len(data) != testLength {
    17  		t.Error("random data did not have expected length:", len(data), "!=", testLength)
    18  	}
    19  }