emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114272: * test/automated/eshell.el (eshell-test-com


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114272: * test/automated/eshell.el (eshell-test-command-result): New,
Date: Fri, 13 Sep 2013 16:11:24 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114272
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2013-09-13 09:11:19 -0700
message:
  * test/automated/eshell.el (eshell-test-command-result): New,
  again using a temp directory.
  Replace eshell-command-result with this throughout.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/eshell.el       eshtest.el-20091113204419-o5vbwnq5f7feedwu-1875
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2013-09-13 03:55:56 +0000
+++ b/test/ChangeLog    2013-09-13 16:11:19 +0000
@@ -2,6 +2,8 @@
 
        * automated/eshell.el (with-temp-eshell):
        Use a temp directory for eshell-directory-name.
+       (eshell-test-command-result): New, again using a temp directory.
+       Replace eshell-command-result with this throughout.
 
 2013-09-12  Glenn Morris  <address@hidden>
 

=== modified file 'test/automated/eshell.el'
--- a/test/automated/eshell.el  2013-09-13 03:55:56 +0000
+++ b/test/automated/eshell.el  2013-09-13 16:11:19 +0000
@@ -56,77 +56,83 @@
   (eshell-insert-command text func)
   (eshell-match-result regexp))
 
+(defun eshell-test-command-result (command)
+  "Like `eshell-command-result', but not using HOME."
+  (let ((eshell-directory-name (make-temp-file "eshell" t))
+        (eshell-history-file-name nil))
+    (eshell-command-result command)))
+
 ;;; Tests:
 
 (ert-deftest eshell-test/simple-command-result ()
   "Test `eshell-command-result' with a simple command."
-  (should (equal (eshell-command-result "+ 1 2") 3)))
+  (should (equal (eshell-test-command-result "+ 1 2") 3)))
 
 (ert-deftest eshell-test/lisp-command ()
   "Test `eshell-command-result' with an elisp command."
-  (should (equal (eshell-command-result "(+ 1 2)") 3)))
+  (should (equal (eshell-test-command-result "(+ 1 2)") 3)))
 
 (ert-deftest eshell-test/for-loop ()
   "Test `eshell-command-result' with an elisp command."
-  (should (equal (eshell-command-result "for foo in 5 { echo $foo }") 5)))
+  (should (equal (eshell-test-command-result "for foo in 5 { echo $foo }") 5)))
 
 (ert-deftest eshell-test/for-name-loop () ;Bug#15231
   "Test `eshell-command-result' with an elisp command."
-  (should (equal (eshell-command-result "for name in 3 { echo $name }") 3)))
+  (should (equal (eshell-test-command-result "for name in 3 { echo $name }") 
3)))
 
 (ert-deftest eshell-test/lisp-command-args ()
   "Test `eshell-command-result' with elisp and trailing args.
 Test that trailing arguments outside the S-expression are
 ignored.  e.g. \"(+ 1 2) 3\" => 3"
-  (should (equal (eshell-command-result "(+ 1 2) 3") 3)))
+  (should (equal (eshell-test-command-result "(+ 1 2) 3") 3)))
 
 (ert-deftest eshell-test/subcommand ()
   "Test `eshell-command-result' with a simple subcommand."
-  (should (equal (eshell-command-result "{+ 1 2}") 3)))
+  (should (equal (eshell-test-command-result "{+ 1 2}") 3)))
 
 (ert-deftest eshell-test/subcommand-args ()
   "Test `eshell-command-result' with a subcommand and trailing args.
 Test that trailing arguments outside the subcommand are ignored.
 e.g. \"{+ 1 2} 3\" => 3"
-  (should (equal (eshell-command-result "{+ 1 2} 3") 3)))
+  (should (equal (eshell-test-command-result "{+ 1 2} 3") 3)))
 
 (ert-deftest eshell-test/subcommand-lisp ()
   "Test `eshell-command-result' with an elisp subcommand and trailing args.
 Test that trailing arguments outside the subcommand are ignored.
 e.g. \"{(+ 1 2)} 3\" => 3"
-  (should (equal (eshell-command-result "{(+ 1 2)} 3") 3)))
+  (should (equal (eshell-test-command-result "{(+ 1 2)} 3") 3)))
 
 (ert-deftest eshell-test/interp-cmd ()
   "Interpolate command result"
-  (should (equal (eshell-command-result "+ ${+ 1 2} 3") 6)))
+  (should (equal (eshell-test-command-result "+ ${+ 1 2} 3") 6)))
 
 (ert-deftest eshell-test/interp-lisp ()
   "Interpolate Lisp form evaluation"
-  (should (equal (eshell-command-result "+ $(+ 1 2) 3") 6)))
+  (should (equal (eshell-test-command-result "+ $(+ 1 2) 3") 6)))
 
 (ert-deftest eshell-test/interp-concat ()
   "Interpolate and concat command"
-  (should (equal (eshell-command-result "+ ${+ 1 2}3 3") 36)))
+  (should (equal (eshell-test-command-result "+ ${+ 1 2}3 3") 36)))
 
 (ert-deftest eshell-test/interp-concat-lisp ()
   "Interpolate and concat Lisp form"
-  (should (equal (eshell-command-result "+ $(+ 1 2)3 3") 36)))
+  (should (equal (eshell-test-command-result "+ $(+ 1 2)3 3") 36)))
 
 (ert-deftest eshell-test/interp-concat2 ()
   "Interpolate and concat two commands"
-  (should (equal (eshell-command-result "+ ${+ 1 2}${+ 1 2} 3") 36)))
+  (should (equal (eshell-test-command-result "+ ${+ 1 2}${+ 1 2} 3") 36)))
 
 (ert-deftest eshell-test/interp-concat-lisp2 ()
   "Interpolate and concat two Lisp forms"
-  (should (equal (eshell-command-result "+ $(+ 1 2)$(+ 1 2) 3") 36)))
+  (should (equal (eshell-test-command-result "+ $(+ 1 2)$(+ 1 2) 3") 36)))
 
 (ert-deftest eshell-test/window-height ()
   "$LINES should equal (window-height)"
-  (should (eshell-command-result "= $LINES (window-height)")))
+  (should (eshell-test-command-result "= $LINES (window-height)")))
 
 (ert-deftest eshell-test/window-width ()
   "$COLUMNS should equal (window-width)"
-  (should (eshell-command-result "= $COLUMNS (window-width)")))
+  (should (eshell-test-command-result "= $COLUMNS (window-width)")))
 
 (ert-deftest eshell-test/last-result-var ()
   "Test using the \"last result\" ($$) variable"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]