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.
17 lines
384 B
Text
17 lines
384 B
Text
import Lean.Data.RBMap
|
|
|
|
open Lean
|
|
|
|
abbrev Tree : Type := RBMap Nat Bool compare
|
|
|
|
def mkMapAux : Nat → Tree → Tree
|
|
| 0, m => m
|
|
| n+1, m => mkMapAux n (m.insert n (n % 10 = 0))
|
|
|
|
def mkMap (n : Nat) :=
|
|
mkMapAux n {}
|
|
|
|
def main (xs : List String) : IO Unit :=
|
|
let m := mkMap xs.head!.toNat!
|
|
let v := m.fold (fun _ r v => if v then r + 1 else r) 0
|
|
IO.println (toString v)
|