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.)
46 lines
731 B
Text
46 lines
731 B
Text
def f (x y : Nat) := x + 2*y
|
|
|
|
namespace Foo
|
|
|
|
local infix:65 (priority := high) "+" => f
|
|
|
|
theorem ex1 (x y : Nat) : x + y = f x y := rfl
|
|
|
|
/-- info: 1+2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
end Foo
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
theorem ex2 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
open Foo
|
|
|
|
theorem ex3 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
section
|
|
def g (x y : Nat) := 3*(x+y)
|
|
|
|
local infix:65 (priority := high) " + " => g
|
|
|
|
theorem ex4 (x y : Nat) : x + y = g x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
end
|
|
|
|
theorem ex5 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|