branch: elpa/typescript-mode
commit 5c9e46b2a1c9b1bd8387dba18c32cb404f67eaeb
Author: Junyoung Clare Jang <[email protected]>
Commit: Ailrun <[email protected]>
Add file for jsdoc tests
---
Makefile | 1 +
typescript-mode-jsdoc-tests.el | 28 ++++++++++++++++++++++++++++
typescript-mode-tests.el | 2 +-
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1846d0e82d..35eda6a12b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ ELS = \
typescript-mode.el \
typescript-mode-test-utilities.el \
typescript-mode-general-tests.el \
+ typescript-mode-jsdoc-tests.el \
typescript-mode-tests.el
ELCS = $(ELS:.el=.elc)
diff --git a/typescript-mode-jsdoc-tests.el b/typescript-mode-jsdoc-tests.el
new file mode 100644
index 0000000000..d21308b1bd
--- /dev/null
+++ b/typescript-mode-jsdoc-tests.el
@@ -0,0 +1,28 @@
+;;; typescript-mode-jsdoc-tests --- This file contains JSDoc related tests for
typescript-mode.el
+
+;;; Commentary:
+;; To understand the definition of JSDoc tag,
+;; see
https://github.com/jsdoc3/jsdoc/blob/b21427343c7294bbf1f14c718a390f3e955e37cb/lib/jsdoc/tag.js#L153-L195
+;; To know how to run the tests, see typescript-mode-tests.el
+
+;;; Code:
+
+(require 'ert)
+(require 'typescript-mode)
+(require 'typescript-mode-test-utilities)
+
+(defun jsdoc-multiline-test (jsdoc-lines specs)
+ ""
+ (let* ((unwrapped-comment-lines
+ (mapcar (lambda (line) (concat " * " line "\n")) jsdoc-lines))
+ (comment-lines
+ (append '("/**\n") unwrapped-comment-lines '(" */"))))
+ (font-lock-test
+ (apply #'concat comment-lines)
+ (cons
+ '(1 . font-lock-comment-delimiter-face)
+ specs))))
+
+(provide 'typescript-mode-jsdoc-tests)
+
+;;; typescript-mode-jsdoc-tests.el ends here
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index c3f2599105..1c8aa75fa2 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -1,4 +1,3 @@
-
;;; typescript-mode-tests --- This file contains automated tests for
typescript-mode.el
;;; Commentary:
@@ -11,6 +10,7 @@
(require 'cl)
(require 'typescript-mode-test-utilities)
(require 'typescript-mode-general-tests)
+(require 'typescript-mode-jsdoc-tests)
(provide 'typescript-mode-tests)