From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#28209: Add tests for Edebug Date: Thu, 24 Aug 2017 20:13:56 -0400 Message-ID: <87lgm8a4hn.fsf@users.sourceforge.net> References: <87y3qadyro.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1503620006 2972 195.159.176.226 (25 Aug 2017 00:13:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 00:13:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 28209@debbugs.gnu.org To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 02:13:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl2FJ-0008Ss-K6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 02:13:09 +0200 Original-Received: from localhost ([::1]:50912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl2FQ-0007wy-3b for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Aug 2017 20:13:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl2FF-0007vt-7c for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 20:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dl2FC-0001TX-1b for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 20:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dl2FB-0001TS-TC for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 20:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dl2FB-00040a-L5 for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 20:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 00:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28209-submit@debbugs.gnu.org id=B28209.150361994715357 (code B ref 28209); Fri, 25 Aug 2017 00:13:01 +0000 Original-Received: (at 28209) by debbugs.gnu.org; 25 Aug 2017 00:12:27 +0000 Original-Received: from localhost ([127.0.0.1]:53349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl2Ed-0003zY-4y for submit@debbugs.gnu.org; Thu, 24 Aug 2017 20:12:27 -0400 Original-Received: from mail-io0-f173.google.com ([209.85.223.173]:34740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl2Ea-0003zF-Lf; Thu, 24 Aug 2017 20:12:25 -0400 Original-Received: by mail-io0-f173.google.com with SMTP id g71so3447561ioe.1; Thu, 24 Aug 2017 17:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=JxLJOdc4k79X1Vgl80rKLPVEs7nnGPCI7Wt5J9gKDks=; b=oYR6NoX06aXiLrp0HquzMT0Mw9aNYCHQhphntvRDX3Vf8Z5jRhLfFuc9fvN26ohE7w mmFWuXE43QyYRnmdlc5MAN3bsYplXi/2TNnqpxu8SgCHa+/oaVFSLkJtS+0SRnUWGrr9 ZXgWoWm0bi2CQYHEvzFssZZNc0ibhPvtG3WCnQ78F2eyxVP+LPsk4bCsxYq10Wyr/Vfi 49ieR4Vbtbini3vQbhqx2HfmbHhNWec/6uLBBMhBZkqzLA7PahwTMqeaB92+bAHnmF4o TGwo8PnQLl2kn1ee8SyZJghOv9fnPJ1rptMPJxsGXHiAZxsmZzCHneycZthcZKJsUQH0 wl+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=JxLJOdc4k79X1Vgl80rKLPVEs7nnGPCI7Wt5J9gKDks=; b=Cy5kcJN6OAURUWPMUa9VoUiFQpK2zSRsH+kx28skC88MxNjTBHlSuo3KoTSOhcaIW+ H7XVLYExrzohOa+4/ZCUip7u1PQAShvvfot5b42FGBpdC066xm/1TwXMPScYz9hNXaSc ZakHlOJVt4bk7KHcc8CtNw2IxgvjR3gXIomOIcOoFHJbohAGvxMOK6EaF50TvS3w9+sG mC/kzRIk4pARBdRDhJnKk/mC26+672iGD5A5WY5Ge6XnOyLHJlwFJ56/7/noEc3mxg+E LnWOZoETapcAv3yX47TgDL7EkQIhbwhflKrMNe0h6I+uFiI9LF4ettGvmVDRa144HLTE PtBg== X-Gm-Message-State: AHYfb5ibiYdgbSqZLyD93yl2p/+YNg9CZnwVtYN5ng2/zOLQGyPgtVzQ LFxdlfRTTZpYxaeq X-Received: by 10.107.142.132 with SMTP id q126mr6823191iod.316.1503619938901; Thu, 24 Aug 2017 17:12:18 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id w79sm2539230iod.20.2017.08.24.17.12.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2017 17:12:17 -0700 (PDT) In-Reply-To: <87y3qadyro.fsf@runbox.com> (Gemini Lasswell's message of "Wed, 23 Aug 2017 09:39:23 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136173 Archived-At: severity 28209 wishlist tags 28209 + patch quit Gemini Lasswell writes: > The first of the two attached patches extends ert-with-message-capture > to catch the output of prin1, princ and print when it is destined for > the echo area. Edebug uses prin1 and princ to show the results of > evaluating expressions. I don't know why it uses them instead of > message, and if there isn't a good reason for it, then modifying Edebug > to use message instead of extending ert-with-message-capture is another > option. If someone with a better understanding than mine of the > difference between princ and message would like to take a look at it, > the relevant code is in edebug-eval-expression and at the end of > edebug-eval-defun. I don't think there is any strong reason to use princ over message. It indents a bit nicer I guess. But it's probably good to extend ert-with-message-capture regardless. > +(defmacro edebug-tests-deftest (name _args docstring &rest keys-and-body) > + "Define an edebug unit test. > +NAME is the name of the test, _ARGS should be nil, and DOCSTRING > +is required. To avoid having to duplicate ERT's keyword parsing > +here, its keywords and values (if any) must be inside a list > +after the docstring, preceding the body, here combined with the > +body in KEYS-AND-BODY." I'm not sure it's worth the trouble to define a test-defining macro. Is there really much advantage compared to just using a macro for each body? (ert-deftest foo () (edebug-tests-normal-env ...)) vs (edebug-tests-deftest foo () ...) > + (edebug-tests-should-be-at 'edebug-test-code-try-flavors "macro") > + "i" (should (string-match-p "edebug-test-code-try-flavors is a built-in macro" "built-in" is copy-pasta I guess?