aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/eshell
diff options
context:
space:
mode:
authorNoam Postavsky2017-10-15 16:41:17 -0400
committerNoam Postavsky2017-10-21 15:19:14 -0400
commit9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed (patch)
treed67e58b6f2682acfd271dd89bd01cc5d39b4cdeb /test/lisp/eshell
parent0f286ca85a259575b67dba520ff72e59cc011426 (diff)
downloademacs-9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed.tar.gz
emacs-9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed.zip
Ignore string properties when saving eshell history (Bug#28700)
* lisp/eshell/em-hist.el (eshell-write-history): Remove properties before inserting history strings. (eshell-read-history): Remove obsolete comment. * test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history): New test.
Diffstat (limited to 'test/lisp/eshell')
-rw-r--r--test/lisp/eshell/em-hist-tests.el39
-rw-r--r--test/lisp/eshell/eshell-tests.el2
2 files changed, 40 insertions, 1 deletions
diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el
new file mode 100644
index 00000000000..7e0d6142812
--- /dev/null
+++ b/test/lisp/eshell/em-hist-tests.el
@@ -0,0 +1,39 @@
1;;; tests/em-hist-tests.el --- em-hist test suite
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 <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'ert)
23(require 'em-hist)
24
25(ert-deftest eshell-write-readonly-history ()
26 "Test that having read-only strings in history is okay."
27 (let ((histfile (make-temp-file "eshell-history"))
28 (eshell-history-ring (make-ring 2)))
29 (ring-insert eshell-history-ring
30 (propertize "echo foo" 'read-only t))
31 (ring-insert eshell-history-ring
32 (propertize "echo bar" 'read-only t))
33 (unwind-protect
34 (eshell-write-history histfile)
35 (delete-file histfile))))
36
37(provide 'em-hist-test)
38
39;;; em-hist-tests.el ends here
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 4e0d6dc7621..58b8aa58bf1 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -247,6 +247,6 @@ chars"
247 (goto-char eshell-last-input-start) 247 (goto-char eshell-last-input-start)
248 (string= (eshell-get-old-input) "echo alpha"))) 248 (string= (eshell-get-old-input) "echo alpha")))
249 249
250(provide 'esh-test) 250(provide 'eshell-tests)
251 251
252;;; tests/eshell-tests.el ends here 252;;; tests/eshell-tests.el ends here