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.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index f50797953c3..2960cca2c06 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -391,7 +391,11 @@ p = (1 + 2)
391 (python-tests-assert-faces 391 (python-tests-assert-faces
392 "b: Tuple[Optional[int], Union[Sequence[str], str]] = (None, 'foo')" 392 "b: Tuple[Optional[int], Union[Sequence[str], str]] = (None, 'foo')"
393 '((1 . font-lock-variable-name-face) (2) 393 '((1 . font-lock-variable-name-face) (2)
394 (4 . font-lock-type-face) (9)
395 (10 . font-lock-type-face) (18)
394 (19 . font-lock-builtin-face) (22) 396 (19 . font-lock-builtin-face) (22)
397 (25 . font-lock-type-face) (30)
398 (31 . font-lock-type-face) (39)
395 (40 . font-lock-builtin-face) (43) 399 (40 . font-lock-builtin-face) (43)
396 (46 . font-lock-builtin-face) (49) 400 (46 . font-lock-builtin-face) (49)
397 (52 . font-lock-operator-face) (53) 401 (52 . font-lock-operator-face) (53)
@@ -402,12 +406,14 @@ p = (1 + 2)
402 (python-tests-assert-faces 406 (python-tests-assert-faces
403 "c: Collection = {1, 2, 3}" 407 "c: Collection = {1, 2, 3}"
404 '((1 . font-lock-variable-name-face) (2) 408 '((1 . font-lock-variable-name-face) (2)
409 (4 . font-lock-type-face) (14)
405 (15 . font-lock-operator-face) (16)))) 410 (15 . font-lock-operator-face) (16))))
406 411
407(ert-deftest python-font-lock-assignment-statement-13 () 412(ert-deftest python-font-lock-assignment-statement-13 ()
408 (python-tests-assert-faces 413 (python-tests-assert-faces
409 "d: Mapping[int, str] = {1: 'bar', 2: 'baz'}" 414 "d: Mapping[int, str] = {1: 'bar', 2: 'baz'}"
410 '((1 . font-lock-variable-name-face) (2) 415 '((1 . font-lock-variable-name-face) (2)
416 (4 . font-lock-type-face) (11)
411 (12 . font-lock-builtin-face) (15) 417 (12 . font-lock-builtin-face) (15)
412 (17 . font-lock-builtin-face) (20) 418 (17 . font-lock-builtin-face) (20)
413 (22 . font-lock-operator-face) (23) 419 (22 . font-lock-operator-face) (23)
@@ -472,14 +478,28 @@ def f(x: CustomInt) -> CustomInt:
472 (58 . font-lock-operator-face) (59) 478 (58 . font-lock-operator-face) (59)
473 (62 . font-lock-operator-face) (63) 479 (62 . font-lock-operator-face) (63)
474 (70 . font-lock-variable-name-face) (72) 480 (70 . font-lock-variable-name-face) (72)
481 (74 . font-lock-type-face) (82)
482 (83 . font-lock-type-face) (92)
475 (94 . font-lock-operator-face) (95) 483 (94 . font-lock-operator-face) (95)
476 (102 . font-lock-operator-face) (103) 484 (102 . font-lock-operator-face) (103)
477 (111 . font-lock-variable-name-face) (114) 485 (111 . font-lock-variable-name-face) (114)
486 (116 . font-lock-type-face) (125)
478 (126 . font-lock-operator-face) (127) 487 (126 . font-lock-operator-face) (127)
479 (128 . font-lock-builtin-face) (131) 488 (128 . font-lock-builtin-face) (131)
480 (136 . font-lock-operator-face) (137) 489 (136 . font-lock-operator-face) (137)
481 (144 . font-lock-keyword-face) (150)))) 490 (144 . font-lock-keyword-face) (150))))
482 491
492(ert-deftest python-font-lock-assignment-statement-19 ()
493 (python-tests-assert-faces
494 "a: List[List[CustomInt], List[CustomInt]] = []"
495 '((1 . font-lock-variable-name-face) (2)
496 (4 . font-lock-type-face) (8)
497 (9 . font-lock-type-face) (13)
498 (14 . font-lock-type-face) (23)
499 (26 . font-lock-type-face) (30)
500 (31 . font-lock-type-face) (40)
501 (43 . font-lock-operator-face) (44))))
502
483(ert-deftest python-font-lock-operator-1 () 503(ert-deftest python-font-lock-operator-1 ()
484 (python-tests-assert-faces 504 (python-tests-assert-faces
485 "1 << 2 ** 3 == +4%-5|~6&7^8%9" 505 "1 << 2 ** 3 == +4%-5|~6&7^8%9"