From: Tommi Komulainen <tommi.komulainen@iki.fi>
To: "20742@debbugs.gnu.org" <20742@debbugs.gnu.org>
Subject: bug#20742: Testcase for #20742
Date: Fri, 19 Jun 2015 17:04:07 +0000 [thread overview]
Message-ID: <CAEFOACZQTE817UP5as+bf43TXiCRc4padtoaC39E-6xCy06NOw@mail.gmail.com> (raw)
In-Reply-To: <CAEFOACZwFq7T-9yginNyQ3hd72tssYykcE9wh3RXXRQQvsJ=Eg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 100 bytes --]
Patch against emacs-24.5 branch to update the tests to check the closing
paren indentation as well.
[-- Attachment #1.2: Type: text/html, Size: 121 bytes --]
[-- Attachment #2: 0001-update-python-tests.el-for-pep8-indentation.patch --]
[-- Type: application/octet-stream, Size: 2717 bytes --]
From 37f56dd48ba6c21455681085579a872aeb267036 Mon Sep 17 00:00:00 2001
From: Tommi Komulainen <tommi.komulainen@iki.fi>
Date: Fri, 19 Jun 2015 18:53:52 +0200
Subject: [PATCH] update python-tests.el for pep8 indentation
Add (failing) test for closing paren indentation when opening paren is not
followed by newline. #20742
---
test/automated/python-tests.el | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 42c26fc..b2631c4 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -172,15 +172,19 @@ aliqua."
(python-tests-with-temp-buffer
"# Aligned with opening delimiter
foo = long_function_name(var_one, var_two,
- var_three, var_four)
+ var_three, var_four,
+ )
"
(should (eq (car (python-indent-context)) :no-indent))
(should (= (python-indent-calculate-indentation) 0))
(python-tests-look-at "foo = long_function_name(var_one, var_two,")
(should (eq (car (python-indent-context)) :after-comment))
(should (= (python-indent-calculate-indentation) 0))
- (python-tests-look-at "var_three, var_four)")
+ (python-tests-look-at "var_three, var_four")
(should (eq (car (python-indent-context)) :inside-paren))
+ (should (= (python-indent-calculate-indentation) 25))
+ (python-tests-look-at ")")
+ (should (eq (car (python-indent-context)) :inside-paren-at-closing-paren))
(should (= (python-indent-calculate-indentation) 25))))
(ert-deftest python-indent-pep8-2 ()
@@ -216,7 +220,8 @@ def long_function_name(
"# Extra indentation is not necessary.
foo = long_function_name(
var_one, var_two,
- var_three, var_four)
+ var_three, var_four,
+)
"
(should (eq (car (python-indent-context)) :no-indent))
(should (= (python-indent-calculate-indentation) 0))
@@ -226,9 +231,12 @@ foo = long_function_name(
(python-tests-look-at "var_one, var_two,")
(should (eq (car (python-indent-context)) :inside-paren-newline-start))
(should (= (python-indent-calculate-indentation) 4))
- (python-tests-look-at "var_three, var_four)")
+ (python-tests-look-at "var_three, var_four")
(should (eq (car (python-indent-context)) :inside-paren-newline-start))
- (should (= (python-indent-calculate-indentation) 4))))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at ")")
+ (should (eq (car (python-indent-context)) :inside-paren-at-closing-paren))
+ (should (= (python-indent-calculate-indentation) 0))))
(ert-deftest python-indent-base-case ()
"Check base case does not trigger errors."
--
2.4.4
next prev parent reply other threads:[~2015-06-19 17:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 7:58 bug#20742: 24.5; python mode indentation fails pep8 Tommi Komulainen
2015-06-05 20:16 ` Glenn Morris
2015-06-05 20:25 ` Tommi Komulainen
2015-06-08 16:28 ` Andreas Röhler
2015-06-19 17:04 ` Tommi Komulainen [this message]
2015-06-20 10:56 ` bug#20742: 24.5; [PATCH] python.el: fix close paren indentation to match pep8 Tommi Komulainen
2017-03-02 2:47 ` npostavs
2019-04-20 20:51 ` Noam Postavsky
2019-04-28 20:47 ` Noam Postavsky
2020-09-17 18:59 ` bug#20560: " Lars Ingebrigtsen
2020-09-17 19:22 ` Noam Postavsky
2020-09-18 11:11 ` Lars Ingebrigtsen
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=CAEFOACZQTE817UP5as+bf43TXiCRc4padtoaC39E-6xCy06NOw@mail.gmail.com \
--to=tommi.komulainen@iki.fi \
--cc=20742@debbugs.gnu.org \
/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).