add a way to get a seeded random source from test/run.bqn
This commit is contained in:
parent
4296c42534
commit
7d55317ec4
10
test/run.bqn
10
test/run.bqn
@ -167,6 +167,7 @@ Run ← { 𝕊 testname:
|
||||
{𝕊: 1 •internal.Temp o.seed}_addPreEval o.randomizeHeuristics
|
||||
|
||||
Eval ← {
|
||||
currTestState ↩ @
|
||||
PreEval@
|
||||
⟨dir, ∾⟨testname,"_line_",•Repr currLn+1,".bqn"⟩, ⟨helpers,"arg0",1⟩⟩ •BQN 𝕩
|
||||
}
|
||||
@ -229,6 +230,13 @@ Run ← { 𝕊 testname:
|
||||
}⍟o.run @
|
||||
}
|
||||
|
||||
currTestState ← @
|
||||
GetTestState ← @⊸≡◶⊢‿{ 𝕊:
|
||||
currTestState ↩ {
|
||||
rand ⇐ •MakeRand o.seed
|
||||
}
|
||||
} {𝕊: currTestState}
|
||||
|
||||
helpers ← {
|
||||
⟨TV⇐Variation, CLR⇐ClearRefs, HasFill, EEqual, ListVariations⟩ ← •internal
|
||||
indistinguishable ← {⟨I⇐Indistinguishable⟩: I; EEqual} •internal
|
||||
@ -263,6 +271,8 @@ helpers ← {
|
||||
⊑r
|
||||
}
|
||||
|
||||
GetRand ⇐ {𝕊: •MakeRand (GetTestState@).rand.Range 1e9}
|
||||
|
||||
_eqvar ⇐ {𝔽 _eqvar0_ ListVariations}
|
||||
_eqvarv_ ⇐ {𝔽 _eqvar0_ (𝕘⊸ListVariations)}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user