diff options
| author | Stefan Monnier | 2014-09-22 10:30:47 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-09-22 10:30:47 -0400 |
| commit | 13b1840d23f1f214bec11a3c6823d675cbd82f28 (patch) | |
| tree | e36cb433377e8d8aa9d4cfd5b1de8fee0795169e /test | |
| parent | 601a0cfe861eac8ed706a2bb3380c5788a1ef701 (diff) | |
| download | emacs-13b1840d23f1f214bec11a3c6823d675cbd82f28.tar.gz emacs-13b1840d23f1f214bec11a3c6823d675cbd82f28.zip | |
Add support for `quote' and `app'.
* lisp/emacs-lisp/pcase.el (pcase--app-subst-match, pcase--app-subst-rest):
New optimization functions.
(pcase--u1): Add support for `quote' and `app'.
(pcase): Document them in the docstring.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/pcase-tests.el | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/automated/pcase-tests.el b/test/automated/pcase-tests.el new file mode 100644 index 00000000000..c51cf8d9573 --- /dev/null +++ b/test/automated/pcase-tests.el | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | ;;; pcase-tests.el --- Test suite for pcase macro. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'ert) | ||
| 25 | |||
| 26 | (ert-deftest pcase-tests-behavior () | ||
| 27 | "Test pcase code." | ||
| 28 | (should (equal (pcase '(1 . 2) ((app car '2) 6) ((app car '1) 5)) 5))) | ||
| 29 | |||
| 30 | ;; Local Variables: | ||
| 31 | ;; no-byte-compile: t | ||
| 32 | ;; End: | ||
| 33 | |||
| 34 | ;;; pcase-tests.el ends here. | ||