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

53 lines
1.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Zero (α : Type) where
zero : α
class AddCommGroup (α : Type) extends Zero α where
class Ring (α : Type) extends Zero α, AddCommGroup α
class Module (R : Type) (M : Type) [Zero R] [Zero M] where
instance (R : Type) [Zero R] : Module R R := ⟨⟩
structure Submodule (R : Type) (M : Type) [Zero R] [Zero M] [Module R M] : Type where
class HasQuotient (A : outParam <| Type) (B : Type) where
quotient' : B → Type
instance Submodule.hasQuotient {R : Type} {M : Type} [Ring R] [AddCommGroup M]
[Module R M]: HasQuotient M (Submodule R M) := ⟨fun _ => M⟩
def Synonym (M : Type) [Zero M] := M
instance Synonym.zero {G : Type} [Zero G] : Zero (Synonym G) := ⟨(Zero.zero : G)⟩
instance Synonym.addCommGroup {G : Type} [AddCommGroup G] : AddCommGroup (Synonym G) :=
{ Synonym.zero with }
instance Synonym.module (M : Type) {R : Type} [Zero R] [Zero M] [Module R M] :
Module R (Synonym M) := { }
variable (R : Type) [Ring R]
set_option maxSynthPendingDepth 2 in
/-- info: Submodule.hasQuotient -/
#guard_msgs in
#synth HasQuotient (Synonym (Synonym R)) (Submodule R (Synonym (Synonym R))) -- works
/--
info: [type_class] max synth pending failures (maxSynthPendingDepth: 1), use `set_option maxSynthPendingDepth <limit>`
AddCommGroup Ruse `set_option diagnostics.threshold <num>` to control threshold for reporting counters
---
error: failed to synthesize
HasQuotient (Synonym (Synonym R)) (Submodule R (Synonym (Synonym R)))
use `set_option diagnostics true` to get diagnostic information
-/
#guard_msgs in
set_option diagnostics true in
#synth HasQuotient (Synonym (Synonym R)) (Submodule R (Synonym (Synonym R))) -- fails
set_option maxSynthPendingDepth 2 in
/-- info: Submodule.hasQuotient -/
#guard_msgs in
#synth HasQuotient (Synonym (Synonym R)) (Submodule R (Synonym (Synonym R))) -- still works