lean4-htt/tests/elab_fail/withSetOptionIn.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

39 lines
894 B
Text

import Lean
/-!
# `withSetOptionIn`
This test checks that `withSetOptionIn` recurses into the command syntax (`stx[2]`) in
`set_option ... in <cmd>`.
Prior to #3806, `withSetOptionIn` erroneously recursed into the syntax `in` (`stx[1]`).
-/
open Lean Elab Command
/-- Trace `foo` when `set_option trace.debug true`. -/
elab "#trace_debug_foo" : command => do trace[debug] "foo"
/-- Elab `cmd` using `withSetOptionIn`. -/
elab "#test " cmd:command : command => withSetOptionIn elabCommand cmd
/-! ## Controls
Ensure that `#trace_debug_foo` works as expected.
-/
#guard_msgs in
#trace_debug_foo
/-- info: [debug] foo -/
#guard_msgs(trace) in
set_option trace.debug true in #trace_debug_foo
/-! ## Test
Should trace `[debug] foo`, and not log the error "unexpected command 'in'".
-/
/-- info: [debug] foo -/
#guard_msgs(trace) in
#test set_option trace.debug true in #trace_debug_foo