From: kobarity <kobarity@gmail.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Lele Gaifax <lele@metapensiero.it>,
62092@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#62092: 30.0.50; "case" does not work as dedenter in Python
Date: Tue, 15 Aug 2023 22:43:19 +0900 [thread overview]
Message-ID: <eke7sf8k5slk.wl-kobarity@gmail.com> (raw)
In-Reply-To: <CA1E3EF4-2799-4B90-8E2C-EE0FEB497028@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
Mattias Engdegård wrote:
>
> The test python-info-dedenter-opening-block-positions-7 added as part of this bug in 8f42db010d ends with
>
> + (equal (list (python-tests-look-at "case 2:" -1)
> + (python-tests-look-at "case 1:" -1 t))
> + (python-info-dedenter-opening-block-positions))))
>
> which, as you can see, isn't actually a check; the `equal` result is thrown away.
> (Emacs master was just changed to detect this, so there is a byte-compiler warning.)
>
> Unfortunately, wrapping the call in `should` fails, so there is more to it.
> Would you please take a look?
Sorry, I meant to use `should'. Another mistake was forgetting to use
RESTORE-POINT argument when calling `python-tests-look-at'. Attached
is the patch to fix this. It also includes the indentation fix for
`python-info-dedenter-opening-block-positions-6'.
[-- Attachment #2: 0001-Fix-test-in-python-tests.el-added-by-bug-62092.patch --]
[-- Type: application/octet-stream, Size: 1943 bytes --]
From a39bc229ae258b04f4463c4cabfbe9f1c48ee7df Mon Sep 17 00:00:00 2001
From: kobarity <kobarity@gmail.com>
Date: Tue, 15 Aug 2023 22:27:45 +0900
Subject: [PATCH] Fix test in python-tests.el added by bug #62092
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-6): Fix indentation.
(python-info-dedenter-opening-block-positions-7): Add calling
`should'. Add RESTORE-POINT argument when calling
`python-tests-look-at'.
---
test/lisp/progmodes/python-tests.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 54e32cbf07b..9f935f2748c 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5973,9 +5973,9 @@ python-info-dedenter-opening-block-positions-6
else
"
(python-tests-look-at "else\n")
- (should
- (equal (list (python-tests-look-at "if (" -1 t))
- (python-info-dedenter-opening-block-positions)))))
+ (should
+ (equal (list (python-tests-look-at "if (" -1 t))
+ (python-info-dedenter-opening-block-positions)))))
(ert-deftest python-info-dedenter-opening-block-positions-7 ()
"Test case blocks."
@@ -5993,9 +5993,9 @@ python-info-dedenter-opening-block-positions-7
(python-tests-look-at "case 2:")
(should-not (python-info-dedenter-opening-block-positions))
(python-tests-look-at "case 3:")
- (equal (list (python-tests-look-at "case 2:" -1)
- (python-tests-look-at "case 1:" -1 t))
- (python-info-dedenter-opening-block-positions))))
+ (should (equal (list (python-tests-look-at "case 2:" -1 t)
+ (python-tests-look-at "case 1:" -1 t))
+ (python-info-dedenter-opening-block-positions)))))
(ert-deftest python-info-dedenter-opening-block-message-1 ()
"Test dedenters inside strings are ignored."
--
2.34.1
next prev parent reply other threads:[~2023-08-15 13:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 5:33 bug#62092: 30.0.50; "case" does not work as dedenter in Python kobarity
2023-03-10 7:36 ` Eli Zaretskii
2023-03-10 8:27 ` kobarity
2023-03-11 0:27 ` Dmitry Gutov
2023-03-11 2:08 ` kobarity
2023-03-11 13:18 ` Dmitry Gutov
2023-03-25 14:13 ` kobarity
2023-03-26 2:04 ` Dmitry Gutov
2023-08-14 15:12 ` Mattias Engdegård
2023-08-15 13:43 ` kobarity [this message]
2023-08-15 15:09 ` Mattias Engdegård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eke7sf8k5slk.wl-kobarity@gmail.com \
--to=kobarity@gmail.com \
--cc=62092@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=lele@metapensiero.it \
--cc=mattias.engdegard@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).