test: More diagnostics for tests

This commit is contained in:
Leni Aniva 2024-03-06 15:14:08 -08:00
parent 4a98b90289
commit 8853b17fee
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
3 changed files with 11 additions and 1 deletions

View File

@ -225,6 +225,10 @@ protected def GoalState.parentExpr? (goalState: GoalState): Option Expr := do
let expr := goalState.mctx.eAssignment.find! parent
let (expr, _) := instantiateMVarsCore (mctx := goalState.mctx) (e := expr)
return expr
protected def GoalState.assignedExprOf? (goalState: GoalState) (mvar: MVarId): Option Expr := do
let expr ← goalState.mctx.eAssignment.find? mvar
let (expr, _) := instantiateMVarsCore (mctx := goalState.mctx) (e := expr)
return expr
end Pantograph

View File

@ -242,7 +242,7 @@ structure GoalPrintResult where
-- The root expression
root?: Option Expression := .none
-- The filling expression of the parent goal
parent?: Option Expression := .none
parent?: Option Expression
deriving Lean.ToJson
-- Diagnostic Options, not available in REPL

View File

@ -103,6 +103,12 @@ def test_tactic : IO LSpec.TestSeq :=
goals? := #[goal1],
}:
Protocol.GoalTacticResult)),
subroutine_step "goal.print"
[("stateId", .num 1)]
(Lean.toJson ({
parent? := .some { pp? := .some "fun x => ?m.11 x" },
}:
Protocol.GoalPrintResult)),
subroutine_step "goal.tactic"
[("stateId", .num 1), ("goalId", .num 0), ("tactic", .str "intro y")]
(Lean.toJson ({