2017-05-12 20:12:23 -04:00
|
|
|
package seq
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-04-05 03:42:38 -04:00
|
|
|
assert "github.com/blend/go-sdk/assert"
|
2017-05-12 20:12:23 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestRandomRegression(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
|
|
|
|
|
|
|
randomProvider := NewRandom().WithLen(4096).WithMax(256)
|
|
|
|
assert.Equal(4096, randomProvider.Len())
|
|
|
|
assert.Equal(256, *randomProvider.Max())
|
|
|
|
|
|
|
|
randomSequence := New(randomProvider)
|
|
|
|
randomValues := randomSequence.Array()
|
2018-09-05 11:45:19 -04:00
|
|
|
assert.Len(randomValues, 4096)
|
2017-05-12 20:12:23 -04:00
|
|
|
assert.InDelta(128, randomSequence.Average(), 10.0)
|
|
|
|
}
|