summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJin Choi <jsc@alum.mit.edu>2022-04-30 13:34:57 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-30 13:38:18 +0200
commit5a10e6377c2b97420e5617f114bb374d67ec1a58 (patch)
tree6fecc12d7767ca06978f94897cfe2812ca859ea4 /test
parent2a2b3f583430df8495b566a1dfb1f41c4d61292f (diff)
downloademacs-5a10e6377c2b97420e5617f114bb374d67ec1a58.tar.gz
Make Python evaluation work more reliably
* lisp/progmodes/python.el (python-shell-buffer-substring): Make more regions valid Python code (bug#55174). Copyright-paperwork-exempt: yes
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/python-tests.el18
1 files changed, 3 insertions, 15 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 1a6a7dc176d..01b233cc425 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -3503,10 +3503,7 @@ def foo():
(should (string= (python-shell-buffer-substring
(python-tests-look-at "print ('a')")
(point-max))
- "if True:
-
- print ('a')
-"))))
+ "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n"))))
(ert-deftest python-shell-buffer-substring-11 ()
"Check substring from partial block and point within indentation."
@@ -3521,10 +3518,7 @@ def foo():
(backward-char 1)
(point))
(point-max))
- "if True:
-
- print ('a')
-"))))
+ "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n"))))
(ert-deftest python-shell-buffer-substring-12 ()
"Check substring from partial block and point in whitespace."
@@ -3539,13 +3533,7 @@ def foo():
(should (string= (python-shell-buffer-substring
(python-tests-look-at "# Whitespace")
(point-max))
- "if True:
-
-
- # Whitespace
-
- print ('a')
-"))))
+ "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n"))))