summaryrefslogtreecommitdiff
path: root/.emacs.d.back/packages/all-the-icons/test/all-the-icons-test.el
blob: 0fae192dbfbbbdaa8829424d9825ea006814e73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;;; all-the-icons-test.el --- Tests for `all-the-icons'

;; Copyright (C) 2017  Dominic Charlesworth <dgc336@gmail.com>

;; Author: Dominic Charlesworth <dgc336@gmail.com>
;; Keywords: test
;; Created: 09 May 2017

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Test cases for `all-the-icons'

;; Define all tests for mode icons
(require 'f)

(defvar all-the-icons--root-test (f-dirname (f-this-file)))
(defvar all-the-icons--root-code (f-parent all-the-icons--root-test))

(require 'all-the-icons (expand-file-name "all-the-icons.el" all-the-icons--root-code))

(cl-loop
 for alist in (apropos-internal "^all-the-icons-[a-z\\-]*icon-alist$")
 do (cl-loop
     for config in (symbol-value alist)
     do (cl-destructuring-bind (mode f &optional icon &rest args) config
          (when icon
            (eval
             `(ert-deftest ,(intern (format "all-the-icons--validate:%s:%s" alist mode)) ()
                ,(format "A test to validate that the config for %s in `%s' is correct" icon alist)
                (should (funcall ',f ,icon))))))))

(ert "all-the-icons--validate:")

(provide 'all-the-icons-test)
;;; all-the-icons-test.el ends here