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

25 lines
544 B
Text

import Lean
syntax (name := test) "test%" ident : command
open Lean.Elab
open Lean.Elab.Command
@[command_elab test] def elabTest : CommandElab := fun stx => do
let id ← liftCoreM <| realizeGlobalConstNoOverloadWithInfo stx[1]
liftTermElabM do
IO.println (repr (← Lean.Meta.Match.getEquationsFor id))
return ()
def f (x : List Nat) : Nat :=
match x with
| [] => 1
| [a] => 2
| _ => 3
test% f.match_1
#check @f.match_1
#check @f.match_1.splitter
theorem ex (x : List Nat) : f x > 0 := by
simp [f]
split <;> decide