lean4-htt/tests/elab/8049.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

37 lines
919 B
Text

import Lean.Meta
/-!
Traces inside `realizeConst` should be shown at each use (but at most once per elaboration branch)
and have to be enabled before the base declaration.
-/
set_option trace.Elab.debug true
def foo := True
open Lean Meta
-- NOTE: declaring and running a `realizeConst` invocation isn't usually done in the same file, so
-- changing the closure below may require a server restart to see the changes.
elab "test" : tactic => do
realizeConst ``foo `foo.test do
trace[Elab.debug] "traced"
--logWarning "warned"
addDecl <| Declaration.thmDecl {
name := `foo.test
type := mkConst ``True
value := mkConst ``True.intro
levelParams := []
}
/-- trace: [Elab.debug] traced -/
#guard_msgs in
theorem f1 : True := by test; trivial
/-- trace: [Elab.debug] traced -/
#guard_msgs in
def f2 : True := by test; trivial
#guard_msgs in
def f3 : True := by test; trivial