[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 20af0fec5f 077/222: Extend function prefix
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 20af0fec5f 077/222: Extend function prefix font-lock test to check arguments are correct. |
Date: |
Sun, 6 Feb 2022 16:59:19 -0500 (EST) |
branch: elpa/typescript-mode
commit 20af0fec5f6560e9cc2744dea8fceceebe2eefe4
Author: Jack Williams <jw@jackw.io>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Extend function prefix font-lock test to check arguments are correct.
---
typescript-mode-tests.el | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 01039e7db5..5e05b94435 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -256,18 +256,32 @@ new line after the start of '/**'."
("@param" . typescript-jsdoc-tag)
("meow" . typescript-jsdoc-value))))
+(defun copy-test-n (n location-root expected)
+ (let (tests)
+ (dotimes (i n tests)
+ (setq tests
+ (cons (cons (concat location-root (number-to-string i)) expected)
+ tests)))))
+
(ert-deftest font-lock/function-definition-prefixes ()
"Tests that function names are highlighted in definitions, even
when prefixed with module modifiers."
(font-lock-test
- "function basicDefn(x: number, y: string): boolean {}\n
-export function exportedDefn(x: number, y: string): boolean {}\n
-export default function exportedDefaultDefn(x: number, y: string): boolean {}\n
-declare function declareFunctionDefn(x: number, y: string): boolean;"
- '(("basicDefn" . font-lock-function-name-face)
- ("exportedDefn" . font-lock-function-name-face)
- ("exportedDefaultDefn" . font-lock-function-name-face)
- ("declareFunctionDefn" . font-lock-function-name-face))))
+ "function basicDefn(x0: xty0, y0: yty0): ret0 {}\n
+export function exportedDefn(x1: xty1, y1: yty1): ret1 {}\n
+export default function exportedDefaultDefn(x2: xty2, y2: yty2): ret2 {}\n
+declare function declareFunctionDefn(x3: xty3, y3: yty3): ret3;"
+ (append
+ '(("basicDefn" . font-lock-function-name-face)
+ ("exportedDefn" . font-lock-function-name-face)
+ ("exportedDefaultDefn" . font-lock-function-name-face)
+ ("declareFunctionDefn" . font-lock-function-name-face))
+ (copy-test-n 4 "x" font-lock-variable-name-face)
+ (copy-test-n 4 "y" font-lock-variable-name-face)
+ (copy-test-n 4 "xty" font-lock-variable-name-face)
+ (copy-test-n 4 "yty" font-lock-variable-name-face)
+ ;; Return types are not highlighted currently.
+ (copy-test-n 4 "ret" nil))))
(defun flyspell-predicate-test (search-for)
"This function runs a test on
- [nongnu] elpa/typescript-mode 39827549ef 017/222: Merge pull request #13 from wingyplus/highlight-set-and-get-keyword, (continued)
- [nongnu] elpa/typescript-mode 39827549ef 017/222: Merge pull request #13 from wingyplus/highlight-set-and-get-keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 266be8f6c7 018/222: added "readonly" keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 588d5f3d63 027/222: Update README.md, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f72826e564 036/222: Merge pull request #25 from ananthakumaran/revert-24-wrong-cursor-position, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d5c4fb27c8 034/222: Merge pull request #24 from hekt/wrong-cursor-position, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 447cfbc078 030/222: Improve compilation-mode support., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b502d8453d 041/222: On second thought, lets NOT support Emacs 24.1 and 24.2., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f25f4751fe 052/222: Merge pull request #31 from lddubeau/fix/spread-syntax, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2587e92851 047/222: Don't interpret class members as keywords., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode face381789 083/222: Implement clean make-target to assist local development., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 20af0fec5f 077/222: Extend function prefix font-lock test to check arguments are correct.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 5e2165d4b6 038/222: We need a Gitignore-file., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 330c887241 095/222: Fix indentation of functions with numbers in return type., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b7074c5dea 106/222: Remove redundant code, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bf9a4155cc 043/222: Revise Emacs versions tested a little more., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a3c91282bc 039/222: Add test-case and indentation-reference document., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d29f31c791 045/222: Fix indentation of methods that are generators., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e780858a86 050/222: Don't interpret spread syntax as a continuation., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f3140123d6 067/222: Remove a leftover comment., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode aae70b59e6 023/222: Merge pull request #16 from wingyplus/add-as-and-from-keywords, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 3766e37f24 026/222: Add README, ELPA Syncer, 2022/02/06