aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2020-05-13 01:48:55 +0200
committerStefan Kangas2020-05-13 02:05:18 +0200
commit60c9a534291c21cc1f9ebe9dcbe325c91e1d7fc2 (patch)
tree287e60c80506cba5f407af3a24dec8b88800d181 /test
parentcf453495898a5f67d4d02e6d8980f148ee87c37f (diff)
downloademacs-60c9a534291c21cc1f9ebe9dcbe325c91e1d7fc2.tar.gz
emacs-60c9a534291c21cc1f9ebe9dcbe325c91e1d7fc2.zip
Use lexical-binding in dissociate.el and add tests
* lisp/play/dissociate.el: Use lexical-binding. * test/lisp/play/dissociate-tests.el: New file.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/play/dissociate-tests.el38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lisp/play/dissociate-tests.el b/test/lisp/play/dissociate-tests.el
new file mode 100644
index 00000000000..e8d903109fc
--- /dev/null
+++ b/test/lisp/play/dissociate-tests.el
@@ -0,0 +1,38 @@
1;;; dissociate-tests.el --- Tests for dissociate.el -*- lexical-binding:t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22;;; Code:
23
24(require 'ert)
25(require 'dissociate)
26
27(ert-deftest dissociate-tests-dissociated-press ()
28 (cl-letf (((symbol-function 'y-or-n-p) (lambda (_) nil))
29 ((symbol-function 'random) (lambda (_) 10)))
30 (save-window-excursion
31 (with-temp-buffer
32 (insert "Lorem ipsum dolor sit amet")
33 (dissociated-press)
34 (should (string-match-p "dolor sit ametdolor sit amdolor sit amdolor sit am"
35 (buffer-string)))))))
36
37(provide 'dissociate-tests)
38;;; dissociate-tests.el ends here