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.)
34 lines
759 B
Text
34 lines
759 B
Text
import Lean
|
|
|
|
|
|
open Lean
|
|
open Lean.Elab
|
|
open Lean.Elab.Term
|
|
|
|
def tst1 : TermElabM Unit := do
|
|
let opt ← getOptions;
|
|
let stx ← `(forall (a b : Nat), Nat);
|
|
IO.println "message 1"; -- This message goes direct to stdio. It will be displayed before trace messages.
|
|
let e ← elabTermAndSynthesize stx none;
|
|
trace[Elab.debug] m!">>> {e}"; -- display message when `trace.Elab.debug` is true
|
|
IO.println "message 2"
|
|
|
|
/--
|
|
info: message 1
|
|
message 2
|
|
-/
|
|
#guard_msgs in
|
|
#eval tst1
|
|
|
|
def tst2 : TermElabM Unit := do
|
|
let opt ← getOptions;
|
|
let a := mkIdent `a;
|
|
let b := mkIdent `b;
|
|
let stx ← `((fun ($a : Type) (x : $a) => @id $a x) _ 1);
|
|
let e ← elabTermAndSynthesize stx none;
|
|
trace[Elab.debug] m!">>> {e}";
|
|
throwErrorIfErrors
|
|
|
|
/-- info: -/
|
|
#guard_msgs in
|
|
#eval tst2
|