lean4-htt/tests/lean/run/enumDecEq.lean
Kim Morrison 3a457e6ad6
chore: use #guard_msgs in run tests (#4175)
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.)
2024-05-16 00:38:31 +00:00

56 lines
1.1 KiB
Text

inductive Foo1 where
| a1
deriving DecidableEq
/--
info: def Foo1.ofNat : Nat → Foo1 :=
fun n => Foo1.a1
-/
#guard_msgs in
#print Foo1.ofNat
inductive Foo2 where
| a1 | a2
deriving DecidableEq
/--
info: def Foo2.ofNat : Nat → Foo2 :=
fun n => bif n.beq 0 then Foo2.a1 else Foo2.a2
-/
#guard_msgs in
#print Foo2.ofNat
inductive Foo3 where
| a1 | a2 | a3
deriving DecidableEq
/--
info: def Foo3.ofNat : Nat → Foo3 :=
fun n => bif Nat.ble 1 n then bif n.beq 1 then Foo3.a2 else Foo3.a3 else Foo3.a1
-/
#guard_msgs in
#print Foo3.ofNat
inductive Foo4 where
| a1 | a2 | a3 | a4
deriving DecidableEq
/--
info: def Foo4.ofNat : Nat → Foo4 :=
fun n => bif Nat.ble 2 n then bif n.beq 2 then Foo4.a3 else Foo4.a4 else bif n.beq 0 then Foo4.a1 else Foo4.a2
-/
#guard_msgs in
#print Foo4.ofNat
inductive Foo5 where
| a1 | a2 | a3 | a4 | a5
deriving DecidableEq
/--
info: def Foo5.ofNat : Nat → Foo5 :=
fun n =>
bif Nat.ble 2 n then bif Nat.ble 3 n then bif n.beq 3 then Foo5.a4 else Foo5.a5 else Foo5.a3
else bif n.beq 0 then Foo5.a1 else Foo5.a2
-/
#guard_msgs in
#print Foo5.ofNat