aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorJakub Ječmínek2024-01-19 16:38:21 +0100
committerEli Zaretskii2024-01-27 12:05:48 +0200
commit09cdf8a406c5b73e8924a7396c2aaabe74a1a638 (patch)
treed90ed6d61f7a1af203e4fe096b1cfe75dafd931c /test/lisp/progmodes/python-tests.el
parentf0c573d8069f7ee654a550ae3d148325c49900a3 (diff)
downloademacs-09cdf8a406c5b73e8924a7396c2aaabe74a1a638.tar.gz
emacs-09cdf8a406c5b73e8924a7396c2aaabe74a1a638.zip
Fix syntax highlighting after string literal concat in python-mode
* lisp/progmodes/python.el (python-syntax-stringify): Fix incorrect font-lock after string literal concatenation. (Bug#45897) * test/lisp/progmodes/python-tests.el (python-font-lock-string-literal-concatenation): New test. Co-authored-by: kobarity <kobarity@gmail.com> Copyright-paperwork-exempt: yes
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 97ffd5fe20f..59957ff0712 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -660,6 +660,18 @@ r'\\x12 \123 \\n \\u1234 \\U00010348 \\N{Plus-Minus Sign}'"
660 (3 . font-lock-string-face) (14) 660 (3 . font-lock-string-face) (14)
661 (16 . font-lock-string-face)))) 661 (16 . font-lock-string-face))))
662 662
663(ert-deftest python-font-lock-string-literal-concatenation ()
664 "Test for bug#45897."
665 (python-tests-assert-faces
666 "x = \"hello\"\"\"
667y = \"confused\""
668 '((1 . font-lock-variable-name-face) (2)
669 (3 . font-lock-operator-face) (4)
670 (5 . font-lock-string-face) (14)
671 (15 . font-lock-variable-name-face) (16)
672 (17 . font-lock-operator-face) (18)
673 (19 . font-lock-string-face))))
674
663 675
664;;; Indentation 676;;; Indentation
665 677