diff options
| author | Eli Zaretskii | 2023-01-01 05:46:24 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2023-01-01 05:46:24 -0500 |
| commit | 861d3db6343dcd793c54f79a38e0187b4755ee81 (patch) | |
| tree | 5b126c19f878df430395e1012f1891a7cf46d0a0 /test/lisp/progmodes/python-tests.el | |
| parent | 7822fcbebd1edba3654eaf5c1113f9d4049e0462 (diff) | |
| parent | 72a81e20226d2d0745fd2efdbbc80fdfe92b7cde (diff) | |
| download | emacs-861d3db6343dcd793c54f79a38e0187b4755ee81.tar.gz emacs-861d3db6343dcd793c54f79a38e0187b4755ee81.zip | |
Merge from origin/emacs-29
72a81e2022 ; * lisp/treesit.el (treesit-simple-indent-presets): Fix t...
ddfeee3e8a Build recipe interactively in treesit-install-language-gra...
6837469780 ; Add REVISION to treesit-language-source-alist
0dc788aa01 ; Remove GRAMMAR-DIR from treesit-language-source-alist
f9aef67c36 Tweak csharp-mode font-lock-settings (bug#60376)
46362c0a3a ; * doc/lispref/tips.texi (Documentation Tips): Add indexing.
9a386b682e Revert a recent change which causes errors
9871ee8b14 ; More fixes for documentation of 'defalias'
f309651b67 ; Fix handling of 'not' by 'buffer-match-p'
9292f595a7 ; Fix typos
43c7e05a2a Fix misspelled functions in shortdoc groups
01acecc79c Simplify introduction of use-package manual
2a7e072e53 ; Fix documentation of 'defalias'
eee2aeca25 Fix python-shell-buffer-substring when retrieving a single...
bfdad6c4e5 ; Fix recent treesit-related changes
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 64 |
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 | " | ||
| 4463 | def 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 | " | ||
| 4475 | def 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 | " | ||
| 4488 | def 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 | " | ||
| 4500 | def 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 | " | ||
| 4512 | def 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 |