test: Tactic test stub

This commit is contained in:
Leni Aniva 2024-04-20 13:09:41 -07:00
parent 398b1c39ed
commit 4a92e655f6
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
4 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,7 @@ def collectMotiveArguments (forallBody: Expr): SSet Nat :=
| .app (.bvar i) _ => SSet.empty.insert i | .app (.bvar i) _ => SSet.empty.insert i
| _ => SSet.empty | _ => SSet.empty
/-- Applies a symbol of the type `∀ (motive: α → Sort u) (a: α)..., (motive α)` -/
def motivatedApply: Elab.Tactic.Tactic := λ stx => do def motivatedApply: Elab.Tactic.Tactic := λ stx => do
let goal ← Elab.Tactic.getMainGoal let goal ← Elab.Tactic.getMainGoal
let nextGoals: List MVarId ← goal.withContext do let nextGoals: List MVarId ← goal.withContext do

View File

@ -5,6 +5,7 @@ import Test.Library
import Test.Metavar import Test.Metavar
import Test.Proofs import Test.Proofs
import Test.Serial import Test.Serial
import Test.Tactic
-- Test running infrastructure -- Test running infrastructure
@ -48,6 +49,7 @@ def main (args: List String) := do
("Metavar", Metavar.suite env_default), ("Metavar", Metavar.suite env_default),
("Proofs", Proofs.suite env_default), ("Proofs", Proofs.suite env_default),
("Serial", Serial.suite env_default), ("Serial", Serial.suite env_default),
("Tactic/Motivated Apply", Tactic.MotivatedApply.suite env_default),
] ]
let tests: List (String × IO LSpec.TestSeq) := suites.foldl (λ acc (name, suite) => acc ++ (addPrefix name suite)) [] let tests: List (String × IO LSpec.TestSeq) := suites.foldl (λ acc (name, suite) => acc ++ (addPrefix name suite)) []
LSpec.lspecIO (← runTestGroup name_filter tests) LSpec.lspecIO (← runTestGroup name_filter tests)

1
Test/Tactic.lean Normal file
View File

@ -0,0 +1 @@
import Test.Tactic.MotivatedApply

View File

@ -0,0 +1,11 @@
import LSpec
import Lean
open Lean
namespace Pantograph.Test.Tactic.MotivatedApply
def suite (env: Environment): List (String × IO LSpec.TestSeq) :=
[]
end Pantograph.Test.Tactic.MotivatedApply