lean4-htt/tests/elab/customEliminators.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

48 lines
667 B
Text

/-!
# Tests for the custom eliminators feature for `induction` and `cases`
-/
/-!
Test the built-in custom `Nat` eliminator.
-/
/--
error: unsolved goals
case zero
P : Nat → Prop
⊢ P 0
case succ
P : Nat → Prop
n✝ : Nat
a✝ : P n✝
⊢ P (n✝ + 1)
-/
#guard_msgs in
example (P : Nat → Prop) : P n := by
induction n
done
/-!
Turn off the built-in custom `Nat` eliminator.
-/
section
set_option tactic.customEliminators false
/--
error: unsolved goals
case zero
P : Nat → Prop
⊢ P Nat.zero
case succ
P : Nat → Prop
n✝ : Nat
n_ih✝ : P n✝
⊢ P n✝.succ
-/
#guard_msgs in
example (P : Nat → Prop) : P n := by
induction n
done
end