Skip to content

Commit fe51b19

Browse files
committed
Add mldoc-test
1 parent 650359c commit fe51b19

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

mldoc-test.el

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
;;; mldoc-test.el --- Tests for MLDoc -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2019 Friends of Emacs-PHP development
4+
5+
;; Author: USAMI Kenta <[email protected]>
6+
;; Created: 25 Jul 2019
7+
;; Keywords: maint
8+
9+
;; This program is free software; you can redistribute it and/or modify
10+
;; it under the terms of the GNU General Public License as published by
11+
;; the Free Software Foundation, either version 3 of the License, or
12+
;; (at your option) any later version.
13+
14+
;; This program is distributed in the hope that it will be useful,
15+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
;; GNU General Public License for more details.
18+
19+
;; You should have received a copy of the GNU General Public License
20+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
22+
;;; Commentary:
23+
24+
;; Tests for MLDoc.
25+
26+
;;; Code:
27+
(require 'ert)
28+
(require 'mldoc)
29+
(require 'cl-lib)
30+
31+
(ert-deftest mldoc-test--build-list ()
32+
(let ((data
33+
`(("Empty spec and no keywords"
34+
,(mldoc--build-list '())
35+
,(list))
36+
("Spec has a string"
37+
,(mldoc--build-list '(""))
38+
,(list ""))
39+
("Spec has function value"
40+
,(mldoc--build-list '(:foo ": " :function)
41+
:function "f" :values (list :foo "hoge"))
42+
,(list "hoge" ": "
43+
(propertize "f" 'face font-lock-function-name-face))))))
44+
(cl-loop for (desc actual expected) in data
45+
do (should (equal (cons desc expected) (cons desc actual))))))
46+
47+
(provide 'mldoc-test)
48+
;;; mldoc-test.el ends here

0 commit comments

Comments
 (0)