aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 17d6d8aa706..930234a12f2 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -4456,6 +4456,70 @@ def foo():
4456 (point-max)) 4456 (point-max))
4457 "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n")))) 4457 "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n"))))
4458 4458
4459(ert-deftest python-shell-buffer-substring-13 ()
4460 "Check substring from indented single statement."
4461 (python-tests-with-temp-buffer
4462 "
4463def foo():
4464 a = 1
4465"
4466 (should (string= (python-shell-buffer-substring
4467 (python-tests-look-at "a = 1")
4468 (pos-eol))
4469 "# -*- coding: utf-8 -*-\n\na = 1"))))
4470
4471(ert-deftest python-shell-buffer-substring-14 ()
4472 "Check substring from indented single statement spanning multiple lines."
4473 (python-tests-with-temp-buffer
4474 "
4475def foo():
4476 a = \"\"\"Some
4477 string\"\"\"
4478"
4479 (should (string= (python-shell-buffer-substring
4480 (python-tests-look-at "a = \"\"\"Some")
4481 (pos-eol 2))
4482 "# -*- coding: utf-8 -*-\n\na = \"\"\"Some\n string\"\"\""))))
4483
4484(ert-deftest python-shell-buffer-substring-15 ()
4485 "Check substring from partial statement."
4486 (python-tests-with-temp-buffer
4487 "
4488def foo():
4489 a = 1
4490"
4491 (should (string= (python-shell-buffer-substring
4492 (python-tests-look-at " a = 1")
4493 (python-tests-look-at " = 1"))
4494 "# -*- coding: utf-8 -*-\n\na"))))
4495
4496(ert-deftest python-shell-buffer-substring-16 ()
4497 "Check substring from partial statement."
4498 (python-tests-with-temp-buffer
4499 "
4500def foo():
4501 a = 1
4502"
4503 (should (string= (python-shell-buffer-substring
4504 (python-tests-look-at "1")
4505 (1+ (point)))
4506 "# -*- coding: utf-8 -*-\n\n1"))))
4507
4508(ert-deftest python-shell-buffer-substring-17 ()
4509 "Check substring from multiline string."
4510 (python-tests-with-temp-buffer
4511 "
4512def foo():
4513 s = \"\"\"
4514 a = 1
4515 b = 2
4516\"\"\"
4517"
4518 (should (string= (python-shell-buffer-substring
4519 (python-tests-look-at "a = 1")
4520 (python-tests-look-at "\"\"\""))
4521 "# -*- coding: utf-8 -*-\n\nif True:\n a = 1\n b = 2\n\n"))))
4522
4459 4523
4460 4524
4461;;; Shell completion 4525;;; Shell completion