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

40 lines
1.4 KiB
Text

partial def fact : Nat → Nat
| 0 => 1
| (n+1) => (n+1)*fact n
#guard fact 10 == 3628800
#guard fact 100 == 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
theorem tst1 : fact 10 = 3628800 :=
by native_decide
theorem tst2 : fact 100 = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 :=
by native_decide
theorem tst3 : decide (10000000000000000 < 200000000000000000000) = true :=
by native_decide
theorem tst4 : 10000000000000000 < 200000000000000000000 :=
by decide
theorem tst5 : 10000000000000000 < 200000000000000000000 :=
by native_decide
theorem tst6 : 10000000000000000 < 200000000000000000000 :=
let h₁ : 10000000000000000 < 10000000000000010 := by native_decide
let h₂ : 10000000000000010 < 200000000000000000000 := by native_decide
Nat.lt_trans h₁ h₂
theorem tst7 : 10000000000000000 < 200000000000000000000 :=
by decide
theorem tst8 : 10000000000000000 < 200000000000000000000 :=
let h₁ : 10000000000000000 < 10000000000000010 := by decide
let h₂ : 10000000000000010 < 200000000000000000000 := by decide
Nat.lt_trans h₁ h₂
theorem tst9 : 10000000000000000 < 200000000000000000000 :=
by decide
theorem tst10 : 10000000000000000 < 200000000000000000000 :=
by native_decide