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

38 lines
1,016 B
Text

/-!
# Test that `exact?` and `rw?` do not suggest deprecated lemmas
-/
-- Create a deprecated lemma and its non-deprecated replacement
@[deprecated "use myLemma2" (since := "2025-01-01")]
theorem myLemma1 : True := trivial
theorem myLemma2 : True := trivial
-- Test that exact? suggests myLemma2, not the deprecated myLemma1
/--
info: Try this:
[apply] exact myLemma2
-/
#guard_msgs in
example : True := by exact?
-- Create a unique type so our lemmas are the only matches
structure MyType where
val : Nat
def myFn (x : MyType) : MyType := x
-- Create deprecated and non-deprecated rewrite lemmas with unique signature
@[deprecated "use myRwLemma2" (since := "2025-01-01")]
theorem myRwLemma1 (x : MyType) : myFn (myFn x) = myFn x := rfl
theorem myRwLemma2 (x : MyType) : myFn (myFn x) = myFn x := rfl
-- Test that rw? suggests myRwLemma2, not the deprecated myRwLemma1
/--
info: Try this:
[apply] rw [myRwLemma2]
-- no goals
-/
#guard_msgs in
example (x : MyType) : myFn (myFn x) = myFn x := by rw?