Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/Test/Property/ListSetGenerator.flix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
mod JonathanStarup.Test.Property.ListSetGenerator {
use Collectable.collect
use JonathanStarup.ListSet
use Math.Random
use Result.Err
use Result.Ok

Expand All @@ -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())
}
})

Expand Down Expand Up @@ -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))
}
1 change: 1 addition & 0 deletions test/Test/Property/TestListSet.flix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading