lean4-htt/tests/lean/run/inlineLCNFIssue.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

29 lines
1 KiB
Text

import Lean
def explode (x : Nat) : IO Unit := do
if x == 0 then IO.println "arg is 0"
if x == 1 then IO.println "arg is 1"
if x == 2 then IO.println "arg is 2"
if x == 3 then IO.println "arg is 3"
if x == 4 then IO.println "arg is 4"
if x == 5 then IO.println "arg is 5"
if x == 6 then IO.println "arg is 6"
if x == 7 then IO.println "arg is 7"
if x == 8 then IO.println "arg is 8"
if x == 9 then IO.println "arg is 9"
if x == 10 then IO.println "arg is 10"
if x == 11 then IO.println "arg is 11"
if x == 12 then IO.println "arg is 12"
if x == 13 then IO.println "arg is 13"
if x == 14 then IO.println "arg is 14"
if x == 15 then IO.println "arg is 15"
if x == 16 then IO.println "arg is 16"
if x == 17 then IO.println "arg is 17"
if x == 18 then IO.println "arg is 18"
if x == 19 then IO.println "arg is 19"
if x == 20 then IO.println "arg is 20"
run_meta Lean.Compiler.compile #[``explode]
set_option trace.Compiler.result true
run_meta Lean.Compiler.compile #[``explode]