Generate random single instructions
This commit is contained in:
9
test/gen_test.go
Normal file
9
test/gen_test.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import "testing"
|
||||
|
||||
import "github.com/firestuff/subcoding/gen"
|
||||
|
||||
func TestRandProgram(t *testing.T) {
|
||||
gen.RandProgram()
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func TestRandBiasedInt64(t *testing.T) {
|
||||
buckets := [127]uint64{}
|
||||
|
||||
for i := 0; i < 1000000; i++ {
|
||||
val := gen.RandBiasedInt64()
|
||||
val := int64(gen.RandBiasedInt64())
|
||||
switch {
|
||||
case val == 0:
|
||||
buckets[63]++
|
||||
|
||||
Reference in New Issue
Block a user