mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
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.
33 lines
372 B
Lean4
33 lines
372 B
Lean4
def f (x : Nat) :=
|
|
if x = 0 then panic! "unexpected zero"
|
|
else x - 1
|
|
|
|
#eval f 0
|
|
|
|
#eval f 10
|
|
|
|
def g (x : Nat) :=
|
|
if x = 0 then unreachable!
|
|
else x - 1
|
|
|
|
#eval g 0
|
|
|
|
def h (x : Nat) :=
|
|
assert! x != 0;
|
|
x - 1
|
|
|
|
#eval h 1
|
|
#eval h 0
|
|
|
|
def f2 (x : Nat) :=
|
|
dbg_trace "f2, x: {x}";
|
|
x + 1
|
|
|
|
#eval f2 10
|
|
|
|
def g2 (x : Nat) : IO Nat := do
|
|
IO.println "g2 started";
|
|
pure (x + 1)
|
|
|
|
#eval g2 10
|