Closed mwgkgk closed 6 years ago
GNU Coreutil called shuf
takes care of the shuffling!
; Run a list of tests in a randomized order
; (test1 test2 ... testN)
( quote-map =tests
; Construct a list of indices
"shuf -i 0-$1" (tests size 1 -) => % & /output strip "\n" split (int) map
; Use each index to get and run the corresponding test
(:i tests i get apply) map
; Avoid using pop for cleanup
harvest =st
(st () ==) ("\nContaminated stack:\n$1" (st string) => % puts!) unless
) :randomize-tests
If re-seeding min's random
is too far fetched to be actionable, please close this. If the code above looks like it could use improvement please let me know. :+1:
To replicate, run
min -i
:Close interpreter, restart, repeat, observe same sequence.
How to re-seed the random? I'm trying to shuffle a list of tests so that they run independently of each other, just in case some tests might affect others.
Thank you :1st_place_medal: