Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestShuffleSmall (0.14 sec)

  1. src/math/rand/rand_test.go

    	b2 := make([]byte, 128)
    	_, err = r.Read(b2)
    	if err != nil {
    		t.Errorf("read: %v", err)
    	}
    	if !bytes.Equal(b1, b2) {
    		t.Errorf("mismatch after re-seed:\n%x\n%x", b1, b2)
    	}
    }
    
    func TestShuffleSmall(t *testing.T) {
    	// Check that Shuffle allows n=0 and n=1, but that swap is never called for them.
    	r := New(NewSource(1))
    	for n := 0; n <= 1; n++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  2. src/math/rand/v2/rand_test.go

    	}
    
    	r := testRand()
    	for ct := 0; ct < num; ct++ {
    		f := r.Float32()
    		if f >= 1 {
    			t.Fatal("Float32() should be in range [0,1). ct:", ct, "f:", f)
    		}
    	}
    }
    
    func TestShuffleSmall(t *testing.T) {
    	// Check that Shuffle allows n=0 and n=1, but that swap is never called for them.
    	r := testRand()
    	for n := 0; n <= 1; n++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
Back to top