This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
14 lines
441 B
Text
14 lines
441 B
Text
partial def mkAssocArray : Nat → Array (Nat × Bool) → Array (Nat × Bool)
|
||
| 0, as => as
|
||
| i+1, as => mkAssocArray i (as.push (i, i % 2 == 0))
|
||
|
||
def tst (n : Nat) : IO Unit :=
|
||
do
|
||
let as := mkAssocArray n Array.empty;
|
||
IO.println as;
|
||
let as := as.qsort (fun a b => a.1 < b.1);
|
||
for i in [:2*n] do
|
||
let entry := as.binSearch (i, false) (fun a b => a.1 < b.1);
|
||
IO.println (">> " ++ toString i ++ " ==> " ++ toString entry)
|
||
|
||
#eval tst 10
|