Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #597; ProofGeneral cannot step over Fail correctly #607

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions ci/coq-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,44 @@ For example, COMMENT could be (*test-definition*)"
'show-proof-stepwise 'diffs-on))


(ert-deftest 090_coq-test-regression-Fail()
"Test for Fail"
(coq-fixture-on-file
(coq-test-full-path "test_stepwise.v")
(lambda ()
(coq-test-goto-before "(*FailNoTrace*)")
(proof-goto-point)
(proof-shell-wait)
(proof-assert-next-command-interactive) ;; pas the comment
(proof-assert-next-command-interactive)
(proof-shell-wait)
(if (coq--version< (coq-version) "8.10.0")
(coq-should-buffer-string "The command has indeed failed with message:
In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
Tactic failure: Cannot solve this goal.")
(coq-should-buffer-string "The command has indeed failed with message:
Tactic failure: Cannot solve this goal." "*coq*")))))


;; (coq-should-buffer-regexp (regexp-quote "The command has indeed failed with message: Tactic failure: Cannot solve this goal.") "*response*")

(ert-deftest 091_coq-test-regression-Fail()
"Test for Fail"
(coq-fixture-on-file
(coq-test-full-path "test_stepwise.v")
(lambda ()
(coq-test-goto-before "(*FailTrace*)")
(proof-goto-point)
(proof-shell-wait)
(proof-assert-next-command-interactive) ;; pas the comment
(proof-assert-next-command-interactive)
(proof-shell-wait)
;; If coq--post-v811, it should be "Show Proof Diffs." otherwise "Show Proof."
(coq-should-buffer-string "The command has indeed failed with message:
In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
Tactic failure: Cannot solve this goal."))))


(provide 'coq-tests)

;;; coq-tests.el ends here
16 changes: 16 additions & 0 deletions ci/test_stepwise.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ Proof using .
exact proof_of_A.
Qed. (*test-lemma*)

Section failSection.
Local Unset Ltac Backtrace.
Goal False.
Proof. (*FailNoTrace*)
Fail (now auto).
auto.
Abort.

Local Set Ltac Backtrace.
Goal False. (*FailTrace*)
Fail (now auto).
auto.
Abort.
End failSection.


Lemma false_proof : forall A B : bool, A = B.
Proof.
intros A B.
Expand Down
2 changes: 1 addition & 1 deletion coq/coq-syntax.el
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ different."
(defvar coq-symbols-regexp (regexp-opt coq-symbols))

;; ----- regular expressions
(defvar coq-error-regexp "^\\(In nested Ltac call\\|Error:\\|Discarding pattern\\|Syntax error:\\|System Error:\\|User Error:\\|User error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
(defvar coq-error-regexp "\\(?:[^:]\\|[^e]:\\|[^g]e:\\|[^a]ge:\\|[^s]age:\\|[^s]sage:\\|[^e]ssage:\\|[^m]essage:\\)\n\\(In nested Ltac call\\|Error:\\|Discarding pattern\\|Syntax error:\\|System Error:\\|User Error:\\|User error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
"A regexp indicating that the Coq process has identified an error.")

;; april2017: coq-8.7 removes special chars definitely and puts
Expand Down