all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 647488b1dd37f489167d6369e26a98678a8fb76a 2419 bytes (raw)
name: test/automated/font-core.el 	 # note: path name is non-authoritative(*)

 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
;;; font-core.el --- ERT tests for font-core.el -*- lexical-binding: t -*-

;; Copyright (C) 2015 Free Software Foundation, Inc.

;; Author: Michal Nazarewicz <mina86@mina86.com>
;; Keywords: languages, faces
;; Package: emacs

;; This file is part of GNU Emacs.

;; GNU Emacs 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.

;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This package defines regression tests for the font-core package.

;;; Code:

(require 'ert)
(require 'font-core)

(defun font-lock-test-global-modes (func expected-pairs)
  (dolist (pair expected-pairs)
    (let ((font-lock-global-modes (car pair)))
      (funcall func 'foo-mode)
      (should (equal (cdr pair) font-lock-global-modes)))))

(ert-deftest font-lock-test-disable-global-for ()
  "Test `font-lock-disable-global-for' function"
  (font-lock-test-global-modes 'font-lock-disable-global-for
                               '((nil . nil)
                                 (t . (not foo-mode))
                                 ((not bar-mode) . (not foo-mode bar-mode))
                                 ((not foo-mode) . (not foo-mode))
                                 ((foo-mode) . nil)
                                 ((foo-mode bar-mode) . (bar-mode)))))

(ert-deftest font-lock-test-enable-global-for ()
  "Test `font-lock-enable-global-for' function"
  (font-lock-test-global-modes 'font-lock-enable-global-for
                               '((nil . (foo-mode))
                                 (t . t)
                                 ((not bar-mode) . (not bar-mode))
                                 ((not foo-mode bar-mode) . (not bar-mode))
                                 ((not foo-mode) . t)
                                 ((foo-mode) . (foo-mode))
                                 ((bar-mode) . (foo-mode bar-mode)))))

(provide 'font-core-tests)

;;; font-core.el ends here

debug log:

solving 647488b ...
found 647488b in https://yhetil.org/emacs/1420300300-29754-1-git-send-email-mpn@google.com/

applying [1/1] https://yhetil.org/emacs/1420300300-29754-1-git-send-email-mpn@google.com/
diff --git a/test/automated/font-core.el b/test/automated/font-core.el
new file mode 100644
index 0000000..647488b

Checking patch test/automated/font-core.el...
Applied patch test/automated/font-core.el cleanly.

index at:
100644 647488b1dd37f489167d6369e26a98678a8fb76a	test/automated/font-core.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.