From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Dynamic modules: should should-error work? Date: Tue, 24 Nov 2015 19:27:32 +0000 Message-ID: References: <838u5p3n32.fsf@gnu.org> <83si3wzdeb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bb04dc4ea19e305254e550d X-Trace: ger.gmane.org 1448393289 3645 80.91.229.3 (24 Nov 2015 19:28:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Nov 2015 19:28:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 24 20:28:08 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a1JFz-00022N-9R for ged-emacs-devel@m.gmane.org; Tue, 24 Nov 2015 20:28:03 +0100 Original-Received: from localhost ([::1]:40993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JG0-0003dB-FZ for ged-emacs-devel@m.gmane.org; Tue, 24 Nov 2015 14:28:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JFk-0003d6-Ku for emacs-devel@gnu.org; Tue, 24 Nov 2015 14:27:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1JFj-0003YK-OJ for emacs-devel@gnu.org; Tue, 24 Nov 2015 14:27:48 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:33513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JFf-0003Xm-5U; Tue, 24 Nov 2015 14:27:43 -0500 Original-Received: by wmec201 with SMTP id c201so224866695wme.0; Tue, 24 Nov 2015 11:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Xx2LV/Da11UUm0WD+3j8ZPdYQGu9GmOmXHpamuZh2Xg=; b=Mo+ikwVo+7D7u4QgVHmZOEWiQ3wF6cVOQhKKzjKN4SKg5LJIQ19A11fcjLrHrbSmgr z6+jRBBGVWN61lC0KD0adJV2RdZ1ihVY/DlR1siiqlW3IkHo/7AM7ow0lwH00br9oRax vh0wxFGuhGM+5adYhz5f6UohgU3FoqwOEAB5tQWCPZ4S6UWxHykaxZ5TiPuC7Ze0xMk0 1xU9BQVJiPTjCuKtNQwX94N7srAKYKrl8RCLO75trHerxHfrs0q7G+uEd/OUAY3ioD1C NoE6CmJUHj8r53MpGkPTP1ArjFqiZo9VrKlGh1HzeqVVawf2H1anB7x1l0Bn6tmdCPp4 9UDw== X-Received: by 10.195.13.135 with SMTP id ey7mr38147289wjd.25.1448393262633; Tue, 24 Nov 2015 11:27:42 -0800 (PST) In-Reply-To: <83si3wzdeb.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195180 Archived-At: --047d7bb04dc4ea19e305254e550d Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Mo., 23. Nov. 2015 um 21:09 Uhr: > + (let ((descr (should-error (mod-test-sum 1 2 3)))) > + (should (eq (car descr) 'wrong-number-of-arguments)) > I think testing using :type would also accept subtypes of the given type, which I think would be preferrable (I'd expect that generally subtypes of the documented signals are allowed to be thrown). > + (should (stringp (nth 1 descr))) > + (should (eq 0 > + (string-match "# \\(0x\\)?[0-9a-fA-F]+>" > + (nth 1 descr)))) > + (should (= (nth 2 descr) 3)))) > > Maybe replace the regex with "\\`#\\'" to make it work if dladdr is available. --047d7bb04dc4ea19e305254e550d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Mo., 23. Nov. 2015 um 21:09=C2=A0Uhr:
+=C2=A0 (let ((descr (should-error (mod-test-sum 1 2 3))))
+=C2=A0 =C2=A0 (should (eq (car descr) 'wrong-number-of-arguments))
=

I think testing using :type would also acc= ept subtypes of the given type, which I think would be preferrable (I'd= expect that generally subtypes of the documented signals are allowed to be= thrown).
=C2=A0
+=C2=A0 =C2=A0 (should (stringp (nth 1 descr)))
+=C2=A0 =C2=A0 (should (eq 0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-match &quo= t;#<module function at \\(0x\\)?[0-9a-fA-F]+>"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (nth 1 descr))))
+=C2=A0 =C2=A0 (should (=3D (nth 2 descr) 3))))


Maybe replace the regex with "\\`= #<module function.*>\\'" to make it work if dladdr is availa= ble.
=C2=A0
--047d7bb04dc4ea19e305254e550d--