diff options
| author | Nathan Trapuzzano | 2013-12-12 00:47:41 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2013-12-12 00:47:41 -0300 |
| commit | f54de22e65df1f0f0345efce4d6fd3487d0f7bb5 (patch) | |
| tree | 6d409273d9641c2882505033c3ab0e9a50751e35 /test | |
| parent | 6cc4c89b6c45496cc63b3e0cee0971dc1a914015 (diff) | |
| download | emacs-f54de22e65df1f0f0345efce4d6fd3487d0f7bb5.tar.gz emacs-f54de22e65df1f0f0345efce4d6fd3487d0f7bb5.zip | |
* lisp/progmodes/python.el (python-indent-calculate-indentation): When
determining indentation, don't treat "return", "pass", etc., as
operators when they are just string constituents.
* automated/python-test.el (python-indent-block-enders-1): Rename
from python-indent-block-enders.
(python-indent-block-enders-2): New test.
Fixes: debbugs:15812
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 6 | ||||
| -rw-r--r-- | test/automated/python-tests.el | 23 |
2 files changed, 28 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 8fc6bc5158a..ce7208db229 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-12-12 Nathan Trapuzzano <nbtrap@nbtrap.com> | ||
| 2 | |||
| 3 | * automated/python-test.el (python-indent-block-enders-1): Rename | ||
| 4 | from python-indent-block-enders. | ||
| 5 | (python-indent-block-enders-2): New test. | ||
| 6 | |||
| 1 | 2013-12-08 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2013-12-08 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * indent/js.js: New file. | 9 | * indent/js.js: New file. |
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 76a3add6bda..58a839a5500 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -447,7 +447,7 @@ objects = Thing.objects.all() \\\\ | |||
| 447 | (should (eq (car (python-indent-context)) 'after-line)) | 447 | (should (eq (car (python-indent-context)) 'after-line)) |
| 448 | (should (= (python-indent-calculate-indentation) 0)))) | 448 | (should (= (python-indent-calculate-indentation) 0)))) |
| 449 | 449 | ||
| 450 | (ert-deftest python-indent-block-enders () | 450 | (ert-deftest python-indent-block-enders-1 () |
| 451 | "Test `python-indent-block-enders' value honoring." | 451 | "Test `python-indent-block-enders' value honoring." |
| 452 | (python-tests-with-temp-buffer | 452 | (python-tests-with-temp-buffer |
| 453 | " | 453 | " |
| @@ -469,6 +469,27 @@ Class foo(object): | |||
| 469 | (forward-line 1) | 469 | (forward-line 1) |
| 470 | (should (= (python-indent-calculate-indentation) 8)))) | 470 | (should (= (python-indent-calculate-indentation) 8)))) |
| 471 | 471 | ||
| 472 | (ert-deftest python-indent-block-enders-2 () | ||
| 473 | "Test `python-indent-block-enders' value honoring." | ||
| 474 | (python-tests-with-temp-buffer | ||
| 475 | " | ||
| 476 | Class foo(object): | ||
| 477 | '''raise lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do | ||
| 478 | |||
| 479 | eiusmod tempor incididunt ut labore et dolore magna aliqua. | ||
| 480 | ''' | ||
| 481 | def bar(self): | ||
| 482 | \"return (1, 2, 3).\" | ||
| 483 | if self.baz: | ||
| 484 | return (1, | ||
| 485 | 2, | ||
| 486 | 3) | ||
| 487 | " | ||
| 488 | (python-tests-look-at "def") | ||
| 489 | (should (= (python-indent-calculate-indentation) 4)) | ||
| 490 | (python-tests-look-at "if") | ||
| 491 | (should (= (python-indent-calculate-indentation) 8)))) | ||
| 492 | |||
| 472 | 493 | ||
| 473 | ;;; Navigation | 494 | ;;; Navigation |
| 474 | 495 | ||