diff options
| author | Stefan Kangas | 2020-04-29 00:11:56 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-04-29 09:25:02 +0200 |
| commit | c8115e88f180bf33154dcc9de9767bba797af827 (patch) | |
| tree | 0507540df333844702ad92df5b608ee4504b814b | |
| parent | f998e6297dde6c968f7a9f9a5a959d3533c45f02 (diff) | |
| download | emacs-c8115e88f180bf33154dcc9de9767bba797af827.tar.gz emacs-c8115e88f180bf33154dcc9de9767bba797af827.zip | |
Use lexical-binding in float-sup.el and add tests
* lisp/emacs-lisp/float-sup.el: Use lexical-binding.
* test/lisp/emacs-lisp/float-sup-tests.el: New file.
| -rw-r--r-- | lisp/emacs-lisp/float-sup.el | 2 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/float-sup-tests.el | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/float-sup.el b/lisp/emacs-lisp/float-sup.el index 50b157b16a4..d92ca5b9337 100644 --- a/lisp/emacs-lisp/float-sup.el +++ b/lisp/emacs-lisp/float-sup.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; float-sup.el --- define some constants useful for floating point numbers. | 1 | ;;; float-sup.el --- define some constants useful for floating point numbers. -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1987, 2001-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985-1987, 2001-2020 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/test/lisp/emacs-lisp/float-sup-tests.el b/test/lisp/emacs-lisp/float-sup-tests.el new file mode 100644 index 00000000000..9f9a3daa28b --- /dev/null +++ b/test/lisp/emacs-lisp/float-sup-tests.el | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | ;;; float-sup-tests.el --- Tests for float-sup.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 | |||
| 26 | (ert-deftest float-sup-degrees-and-radians () | ||
| 27 | (should (equal (degrees-to-radians 180.0) float-pi)) | ||
| 28 | (should (equal (radians-to-degrees float-pi) 180.0)) | ||
| 29 | (should (equal (radians-to-degrees (degrees-to-radians 360.0)) 360.0)) | ||
| 30 | (should (equal (degrees-to-radians (radians-to-degrees float-pi)) float-pi))) | ||
| 31 | |||
| 32 | (provide 'float-sup-tests) | ||
| 33 | ;;; float-sup-tests.el ends here | ||