diff options
| author | Stefan Kangas | 2020-05-13 02:06:03 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-05-13 02:06:03 +0200 |
| commit | e420910eb62a635ce98e7e7abf583d0cec39f3c7 (patch) | |
| tree | 01eec445d08b7f7d235cc2e302de5875812be78d | |
| parent | 60c9a534291c21cc1f9ebe9dcbe325c91e1d7fc2 (diff) | |
| download | emacs-e420910eb62a635ce98e7e7abf583d0cec39f3c7.tar.gz emacs-e420910eb62a635ce98e7e7abf583d0cec39f3c7.zip | |
Use lexical-binding in animate.el and add tests
* lisp/play/animate.el: Use lexical-binding.
* test/lisp/play/animate-tests.el: New file.
| -rw-r--r-- | lisp/play/animate.el | 2 | ||||
| -rw-r--r-- | test/lisp/play/animate-tests.el | 56 |
2 files changed, 57 insertions, 1 deletions
diff --git a/lisp/play/animate.el b/lisp/play/animate.el index ff464b68049..56c3e350e29 100644 --- a/lisp/play/animate.el +++ b/lisp/play/animate.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; animate.el --- make text dance | 1 | ;;; animate.el --- make text dance -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/test/lisp/play/animate-tests.el b/test/lisp/play/animate-tests.el new file mode 100644 index 00000000000..8af1517ffa4 --- /dev/null +++ b/test/lisp/play/animate-tests.el | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | ;;; animate-tests.el --- Tests for animate.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 'animate) | ||
| 26 | |||
| 27 | (ert-deftest animate-test-birthday-present () | ||
| 28 | (unwind-protect | ||
| 29 | (save-window-excursion | ||
| 30 | (cl-letf (((symbol-function 'sit-for) (lambda (_) nil))) | ||
| 31 | (animate-birthday-present "foo") | ||
| 32 | (should (equal (buffer-string) | ||
| 33 | " | ||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | Happy Birthday, | ||
| 40 | Foo | ||
| 41 | |||
| 42 | |||
| 43 | You are my sunshine, | ||
| 44 | My only sunshine. | ||
| 45 | I'm awful sad that | ||
| 46 | You've moved away. | ||
| 47 | |||
| 48 | Let's talk together | ||
| 49 | And love more deeply. | ||
| 50 | Please bring back | ||
| 51 | my sunshine | ||
| 52 | to stay!")))) | ||
| 53 | (kill-buffer "*A-Present-for-Foo*"))) | ||
| 54 | |||
| 55 | (provide 'animate-tests) | ||
| 56 | ;;; animate-tests.el ends here | ||