unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11218: with-demoted-errors use of condition-case-unless-debug; ert
@ 2012-04-11  3:37 Glenn Morris
  2012-04-11 12:03 ` Lars Magne Ingebrigtsen
  2012-04-11 13:02 ` Stefan Monnier
  0 siblings, 2 replies; 21+ messages in thread
From: Glenn Morris @ 2012-04-11  3:37 UTC (permalink / raw)
  To: 11218

Package: emacs
Version: 24.0.95

with-demoted-errors use of condition-case-unless-debug is annoying.
If I want to debug a condition-case, I'll set debug-on-signal non-nil.
As it stands, with-demoted-errors is not useful if you want to write an
ERT test (for reasons I haven't investigated).

(defun foo ()
  (with-demoted-errors (error "error!"))
  t)

(ert-deftest test-foo ()
  "Test foo"
  (should (foo)))

M-x ert RET test-foo RET

Selector: test-foo
Passed: 0
Failed: 1 (1 unexpected)
Total:  1/1


If you replace with-demoted-errors with ignore-errors, the test passes.





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-11-24 17:34 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11  3:37 bug#11218: with-demoted-errors use of condition-case-unless-debug; ert Glenn Morris
2012-04-11 12:03 ` Lars Magne Ingebrigtsen
2012-04-11 16:16   ` Glenn Morris
2012-04-11 16:28     ` Glenn Morris
2012-04-11 17:57       ` Stefan Monnier
2012-04-11 13:02 ` Stefan Monnier
2012-04-13  0:15   ` Glenn Morris
2012-04-13 13:44     ` Stefan Monnier
2012-04-17 21:30       ` Christian Ohler
2012-04-19  7:46         ` Stefan Monnier
2012-04-20  3:09           ` Christian Ohler
2012-04-20 12:13             ` Stefan Monnier
2012-04-20 21:02               ` Christian Ohler
2012-04-21  2:34                 ` Stefan Monnier
2012-04-23 13:26                   ` Lennart Borgman
2012-04-24  2:04                     ` Stefan Monnier
2012-05-06 18:45                   ` Christian Ohler
2012-05-07  1:12                     ` Stefan Monnier
2012-05-21  3:03                       ` Christian Ohler
2018-08-15  1:10         ` Noam Postavsky
2020-11-24 17:34           ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).