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.
58 lines
839 B
Lean4
58 lines
839 B
Lean4
import Lean
|
|
|
|
open Lean
|
|
|
|
/--
|
|
error: (kernel) type of theorem 'bad' is not a proposition
|
|
Nat
|
|
-/
|
|
#guard_msgs (error) in
|
|
run_meta do
|
|
addDecl <| .thmDecl {
|
|
name := `bad
|
|
levelParams := []
|
|
type := mkConst ``Nat
|
|
value := toExpr 10
|
|
}
|
|
|
|
theorem foo : 10 = 10 := rfl
|
|
where aux : Nat := 20
|
|
|
|
/--
|
|
info: def foo.aux : Nat :=
|
|
20
|
|
-/
|
|
#guard_msgs in
|
|
#print foo.aux
|
|
|
|
|
|
theorem foo2 : 10 = 10 :=
|
|
let rec aux (x : Nat) : Nat := x + 1
|
|
rfl
|
|
|
|
/--
|
|
info: def foo2.aux : Nat → Nat :=
|
|
fun x => x + 1
|
|
-/
|
|
#guard_msgs in
|
|
#print foo2.aux
|
|
|
|
|
|
/--
|
|
error: type of theorem `ugly` is not a proposition
|
|
Nat
|
|
-/
|
|
#guard_msgs (error) in
|
|
theorem ugly : Nat := 10
|
|
|
|
/--
|
|
error: type of theorem `g` is not a proposition
|
|
Nat → Nat
|
|
-/
|
|
#guard_msgs (error) in
|
|
mutual
|
|
theorem f (x : Nat) : x = x := rfl
|
|
|
|
theorem g (x : Nat) : Nat := x + 1
|
|
end
|