From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.help Subject: Re: ERT: should-error doesn't catch failed assertions Date: Mon, 18 Jul 2016 04:19:00 +0000 (UTC) Message-ID: References: <87d1mb9a3u.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1468815596 24636 80.91.229.3 (18 Jul 2016 04:19:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 04:19:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 18 06:19:47 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bP01y-0001TG-EC for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 06:19:46 +0200 Original-Received: from localhost ([::1]:44182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP01u-0003CO-EY for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 00:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP01U-0003CF-71 for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 00:19:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP01P-00028R-VX for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 00:19:15 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP01P-00027k-Om for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 00:19:11 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bP01L-000118-0p for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 06:19:07 +0200 Original-Received: from 206-188-64-44.cpe.distributel.net ([206.188.64.44]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 06:19:07 +0200 Original-Received: from npostavs by 206-188-64-44.cpe.distributel.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 06:19:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 206.188.64.44 (Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110880 Archived-At: Sean McAfee gmail.com> writes: > > I've just begin trying to use ERT to write unit tests for my code. I > got hung up almost immediately when trying to confirm that a particular > function call fails an assertion. A simple example: > > (should-error (cl-assert nil)) Seems to work with (should-error (let ((debug-on-error nil)) (cl-assert nil))) When debug-on-error is non-nil, cl-assert doesn't actually throw an error, it just calls the debugger directly (see cl--assertion-failed). ert binds debug-on-error to t, somewhere along the line.