Generate random single instructions

This commit is contained in:
Ian Gulliver
2021-11-20 17:59:22 -10:00
parent ae771823b0
commit bdb6b17187
7 changed files with 155 additions and 4 deletions

9
test/gen_test.go Normal file
View File

@@ -0,0 +1,9 @@
package test
import "testing"
import "github.com/firestuff/subcoding/gen"
func TestRandProgram(t *testing.T) {
gen.RandProgram()
}

View File

@@ -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]++