summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-06-02 16:22:17 -0400
committerNoam Postavsky <npostavs@gmail.com>2018-06-16 18:34:19 -0400
commit05345babc988060cca540770599282102c34f2a7 (patch)
treee9bef969663372264d34621e03106db997118916 /test/lisp/progmodes/python-tests.el
parent92b609c572c127b6c6616413549809ff20ee30c1 (diff)
downloademacs-05345babc988060cca540770599282102c34f2a7.tar.gz
Fix off by one error in python-mode assertion (Bug#30964)
* lisp/progmodes/python.el (python-nav-end-of-statement): Don't assert that string-start is strictly greater than last-string-end, because the string end is a position outside of the string and may therefore be the same as the following string's start. * test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-2): New test.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 1c4d22d72fa..0b9f8484c10 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2004,6 +2004,12 @@ string
(python-util-forward-comment -1)
(point))))))
+(ert-deftest python-nav-end-of-statement-2 ()
+ "Test the string overlap assertion (Bug#30964)."
+ (python-tests-with-temp-buffer
+ "'\n''\n"
+ (python-nav-end-of-statement)))
+
(ert-deftest python-nav-forward-statement-1 ()
(python-tests-with-temp-buffer
"