all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 22e707120188e995dc09a58934cee0312a454859 1224 bytes (raw)
name: devil-tests.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
 
;;; devil-tests.el --- Tests for devil  -*- lexical-binding: t; -*-

;;; Commentary:

;; Unit tests for the internal devil logic.  Run these with M-x ert
;; RET devil- RET.

;;; Code:

(require 'ert)
(require 'devil)

(ert-deftest devil-invalid-key-p ()
  "Test if `devil--invalid-key-p' words as expected."
  (should (devil--invalid-key-p ""))
  (should (devil--invalid-key-p "C-x-C-f"))
  (should (devil--invalid-key-p "C-x CC-f"))
  (should (not (devil--invalid-key-p "C-x C-f")))
  (should (not (devil--invalid-key-p "C-M-x"))))

(ert-deftest devil-translate ()
  "Test if `devil-translate' works as expected."
  (should (string= (devil-translate (vconcat ",")) "C-"))
  (should (string= (devil-translate (vconcat ",x")) "C-x"))
  (should (string= (devil-translate (vconcat ",x,")) "C-x C-"))
  (should (string= (devil-translate (vconcat ",x,f")) "C-x C-f"))
  (should (string= (devil-translate (vconcat ",,")) ","))
  (should (string= (devil-translate (vconcat ",,,,")) ", ,"))
  (should (string= (devil-translate (vconcat ",mx")) "C-M-x"))
  (should (string= (devil-translate (vconcat ",mmx")) "M-x"))
  (should (string= (devil-translate (vconcat ",mmm")) "M-m")))

(provide 'devil-tests)
;;; devil-tests.el ends here

debug log:

solving 22e7071 ...
found 22e7071 in https://yhetil.org/emacs/87fs84hg3t.fsf@posteo.net/

applying [1/1] https://yhetil.org/emacs/87fs84hg3t.fsf@posteo.net/
diff --git a/devil-tests.el b/devil-tests.el
new file mode 100644
index 0000000..22e7071

Checking patch devil-tests.el...
Applied patch devil-tests.el cleanly.

index at:
100644 22e707120188e995dc09a58934cee0312a454859	devil-tests.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.