]> code.delx.au - gnu-emacs-elpa/blob - test/keywords-tests.el
New transformer: company-sort-prefer-same-case-prefix
[gnu-emacs-elpa] / test / keywords-tests.el
1 ;;; keywords-tests.el --- company-keywords tests -*- lexical-binding: t -*-
2
3 ;; Copyright (C) 2011, 2013-2015 Free Software Foundation, Inc.
4
5 ;; Author: Nikolaj Schumacher
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs 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 ;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22 (require 'company-keywords)
23
24 (ert-deftest company-sorted-keywords ()
25 "Test that keywords in `company-keywords-alist' are in alphabetical order."
26 (dolist (pair company-keywords-alist)
27 (when (consp (cdr pair))
28 (let ((prev (cadr pair)))
29 (dolist (next (cddr pair))
30 (should (not (equal prev next)))
31 (should (string< prev next))
32 (setq prev next))))))