From 2f91ca574c523f95ae35a299be1546283464d503 Mon Sep 17 00:00:00 2001 From: Magnus Madsen Date: Tue, 10 Mar 2026 14:31:26 +0100 Subject: [PATCH] fix: compilation --- test/Test/Property/ListSetGenerator.flix | 8 ++++++-- test/Test/Property/TestListSet.flix | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/Test/Property/ListSetGenerator.flix b/test/Test/Property/ListSetGenerator.flix index 81ca278..49012b5 100644 --- a/test/Test/Property/ListSetGenerator.flix +++ b/test/Test/Property/ListSetGenerator.flix @@ -17,6 +17,7 @@ mod JonathanStarup.Test.Property.ListSetGenerator { use Collectable.collect use JonathanStarup.ListSet + use Math.Random use Result.Err use Result.Ok @@ -33,7 +34,7 @@ mod JonathanStarup.Test.Property.ListSetGenerator { if (get(runningLength) <= 0) None else { runningLength |> transform(Sub.sub(1)); - Some(Random.randomInt32()) + Some(randomInt32()) } }) @@ -71,6 +72,9 @@ mod JonathanStarup.Test.Property.ListSetGenerator { } def nextNatWithMax(max: Int32): Int32 \ Random = { - Int32.modulo(Random.randomInt32(), Int32.max(max, 1)) + Int32.modulo(randomInt32(), Int32.max(max, 1)) } + + def randomInt32(): Int32 \ Random = + Int64.clampToInt32(min = Int32.minValue(), max = Int32.maxValue(), Int64.rightShift(Random.randomInt64(), 32)) } diff --git a/test/Test/Property/TestListSet.flix b/test/Test/Property/TestListSet.flix index 51a2b52..1d33b37 100644 --- a/test/Test/Property/TestListSet.flix +++ b/test/Test/Property/TestListSet.flix @@ -19,6 +19,7 @@ mod JonathanStarup.Test.Property.TestListSet { use JonathanStarup.Test.Property.ListSetGenerator use Abort.abort use Formattable.format + use Math.Random def runTest( tests: Int32, seed: Int64, prop: c -> Unit \ Assert