aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Monnier2017-02-23 21:06:54 -0500
committerStefan Monnier2017-02-23 21:06:54 -0500
commit407e650413c0296f5873a1399c2306b25f81f310 (patch)
tree7ef40c77b1a38cf127c07cf4662497b8170a658b /test
parentf6d2ba74f80b9a055a3d8072d49475aec45c2dbe (diff)
downloademacs-407e650413c0296f5873a1399c2306b25f81f310.tar.gz
emacs-407e650413c0296f5873a1399c2306b25f81f310.zip
* lisp/emacs-lisp/cl-print.el: New file
* lisp/emacs-lisp/nadvice.el (advice--where): New function. (advice--make-docstring): Use it. * src/print.c (print_number_index): Don't declare here any more. (Fprint_preprocess): New function. * test/lisp/emacs-lisp/cl-print-tests.el: New file.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/cl-print-tests.el40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/cl-print-tests.el
new file mode 100644
index 00000000000..cbc79b0e64a
--- /dev/null
+++ b/test/lisp/emacs-lisp/cl-print-tests.el
@@ -0,0 +1,40 @@
1;;; cl-print-tests.el --- Test suite for the cl-print facility. -*- lexical-binding:t -*-
2
3;; Copyright (C) 2017 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(cl-defstruct cl-print--test a b)
27
28(ert-deftest cl-print-tests-1 ()
29 "Test cl-print code."
30 (let ((x (make-cl-print--test :a 1 :b 2)))
31 (let ((print-circle nil))
32 (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x)))
33 "((x . #s(cl-print--test :a 1 :b 2)) (y . #s(cl-print--test :a 1 :b 2)))")))
34 (let ((print-circle t))
35 (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x)))
36 "((x . #1=#s(cl-print--test :a 1 :b 2)) (y . #1#))")))
37 (should (string-match "\\`#<compiled-function (x) .*>\\'"
38 (cl-prin1-to-string (symbol-function #'caar))))))
39
40;;; cl-print-tests.el ends here.