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.
57 lines
1.1 KiB
Text
57 lines
1.1 KiB
Text
/-
|
|
Test file for the ∎ (QED) macro which expands to `try?`
|
|
-/
|
|
|
|
import Lean.Elab.Tactic.Try
|
|
|
|
-- Basic tactic mode usage - should suggest tactics
|
|
/--
|
|
info: Try these:
|
|
[apply] rfl
|
|
[apply] simp
|
|
[apply] simp only [Nat.reduceAdd]
|
|
[apply] grind
|
|
[apply] grind only
|
|
[apply] simp_all
|
|
-/
|
|
#guard_msgs in
|
|
example : 1 + 1 = 2 := by
|
|
∎
|
|
|
|
-- Term mode usage - should suggest terms with "by"
|
|
/--
|
|
info: Try these:
|
|
[apply] by rfl
|
|
[apply] by simp
|
|
[apply] by simp only [Nat.reduceAdd]
|
|
[apply] by grind
|
|
[apply] by grind only
|
|
[apply] by simp_all
|
|
-/
|
|
#guard_msgs in
|
|
example : 1 + 1 = 2 :=
|
|
∎
|
|
|
|
-- With hypotheses in term mode
|
|
/--
|
|
info: Try these:
|
|
[apply] by solve_by_elim
|
|
[apply] by simp [*]
|
|
[apply] by simp only [h]
|
|
[apply] by grind
|
|
[apply] by grind only
|
|
[apply] by simp_all
|
|
-/
|
|
#guard_msgs in
|
|
example (a b : Nat) (h : a = b) : b = a :=
|
|
∎
|
|
|
|
-- Check that error messages are appropriate when try? fails
|
|
/--
|
|
error: Tactic `try?` failed: consider using `grind` manually, or `try? +missing` for partial proofs containing `sorry`
|
|
|
|
⊢ False
|
|
-/
|
|
#guard_msgs in
|
|
example : False := by
|
|
∎
|