Many of our tests in `tests/lean/run/` produce output from `#eval` (or `#check`) statements, that is then ignored. This PR tries to capture all the useful output using `#guard_msgs`. I've only done a cursory check that the output is still sane --- there is a chance that some "unchecked" tests have already accumulated regressions and this just cements them! In the other direction, I did identify two rotten tests: * a minor one in `setStructInstNotation.lean`, where a comment says `Set Nat`, but `#check` actually prints `?_`. Weird? * `CompilerProbe.lean` is generating empty output, apparently indicating that something is broken, but I don't know the signficance of this file. In any case, I'll ask about these elsewhere. (This started by noticing that a recent `grind` test file had an untested `trace_state`, and then got carried away.)
41 lines
1,009 B
Text
41 lines
1,009 B
Text
namespace Ex1
|
||
mutual
|
||
def f : Nat → α → α → α
|
||
| 0, a, b => a
|
||
| n, a, b => g a n b |>.1
|
||
termination_by n _ _ => (n, 2)
|
||
|
||
def g : α → Nat → α → (α × α)
|
||
| a, 0, b => (a, b)
|
||
| a, n, b => (h a b n, a)
|
||
termination_by _ n _ => (n, 1)
|
||
|
||
def h : α → α → Nat → α
|
||
| a, b, 0 => b
|
||
| a, b, n+1 => f n a b
|
||
termination_by _ _ n => (n, 0)
|
||
end
|
||
|
||
/--
|
||
info: @[irreducible] def Ex1.f.{u_1} : {α : Type u_1} → Nat → α → α → α :=
|
||
fun {α} a a_1 a_2 => f._mutual (PSum.inl ⟨a, ⟨a_1, a_2⟩⟩)
|
||
-/
|
||
#guard_msgs in
|
||
#print f
|
||
|
||
/--
|
||
info: @[irreducible] def Ex1.g.{u_1} : {α : Type u_1} → α → Nat → α → α × α :=
|
||
fun {α} a a_1 a_2 => f._mutual (PSum.inr (PSum.inl ⟨a, ⟨a_1, a_2⟩⟩))
|
||
-/
|
||
#guard_msgs in
|
||
#print g
|
||
|
||
/--
|
||
info: @[irreducible] def Ex1.h.{u_1} : {α : Type u_1} → α → α → Nat → α :=
|
||
fun {α} a a_1 a_2 => f._mutual (PSum.inr (PSum.inr ⟨a, ⟨a_1, a_2⟩⟩))
|
||
-/
|
||
#guard_msgs in
|
||
#print h
|
||
|
||
#guard f 5 'a' 'b' == 'a'
|
||
end Ex1
|