aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorDmitry Gutov2022-08-15 02:22:59 +0300
committerDmitry Gutov2022-08-15 02:22:59 +0300
commitee3a674c7c9e39fe7ff296ce1f9830fc45520de8 (patch)
treee8ba1e7be54314f208454e80e3d31044c913f3eb /test/lisp/eshell/eshell-tests.el
parentfe0e53d963899a16e0dd1bbc1ba10a6b59f7989e (diff)
parent0a8e88fd83db5398d36064a7f87cff5b57da7284 (diff)
downloademacs-scratch/font_lock_large_files.tar.gz
emacs-scratch/font_lock_large_files.zip
Merge branch 'master' into scratch/font_lock_large_filesscratch/font_lock_large_files
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r--test/lisp/eshell/eshell-tests.el53
1 files changed, 0 insertions, 53 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 5dc18775485..8423500ea7d 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -36,59 +36,6 @@
36 36
37;;; Tests: 37;;; Tests:
38 38
39(ert-deftest eshell-test/simple-command-result ()
40 "Test `eshell-command-result' with a simple command."
41 (should (equal (eshell-test-command-result "+ 1 2") 3)))
42
43(ert-deftest eshell-test/lisp-command ()
44 "Test `eshell-command-result' with an elisp command."
45 (should (equal (eshell-test-command-result "(+ 1 2)") 3)))
46
47(ert-deftest eshell-test/lisp-command-with-quote ()
48 "Test `eshell-command-result' with an elisp command containing a quote."
49 (should (equal (eshell-test-command-result "(eq 'foo nil)") nil)))
50
51(ert-deftest eshell-test/for-loop ()
52 "Test `eshell-command-result' with a for loop.."
53 (let ((process-environment (cons "foo" process-environment)))
54 (should (equal (eshell-test-command-result
55 "for foo in 5 { echo $foo }") 5))))
56
57(ert-deftest eshell-test/for-name-loop () ;Bug#15231
58 "Test `eshell-command-result' with a for loop using `name'."
59 (let ((process-environment (cons "name" process-environment)))
60 (should (equal (eshell-test-command-result
61 "for name in 3 { echo $name }") 3))))
62
63(ert-deftest eshell-test/for-name-shadow-loop () ; bug#15372
64 "Test `eshell-command-result' with a for loop using an env-var."
65 (let ((process-environment (cons "name=env-value" process-environment)))
66 (with-temp-eshell
67 (eshell-command-result-p "echo $name; for name in 3 { echo $name }; echo $name"
68 "env-value\n3\nenv-value\n"))))
69
70(ert-deftest eshell-test/lisp-command-args ()
71 "Test `eshell-command-result' with elisp and trailing args.
72Test that trailing arguments outside the S-expression are
73ignored. e.g. \"(+ 1 2) 3\" => 3"
74 (should (equal (eshell-test-command-result "(+ 1 2) 3") 3)))
75
76(ert-deftest eshell-test/subcommand ()
77 "Test `eshell-command-result' with a simple subcommand."
78 (should (equal (eshell-test-command-result "{+ 1 2}") 3)))
79
80(ert-deftest eshell-test/subcommand-args ()
81 "Test `eshell-command-result' with a subcommand and trailing args.
82Test that trailing arguments outside the subcommand are ignored.
83e.g. \"{+ 1 2} 3\" => 3"
84 (should (equal (eshell-test-command-result "{+ 1 2} 3") 3)))
85
86(ert-deftest eshell-test/subcommand-lisp ()
87 "Test `eshell-command-result' with an elisp subcommand and trailing args.
88Test that trailing arguments outside the subcommand are ignored.
89e.g. \"{(+ 1 2)} 3\" => 3"
90 (should (equal (eshell-test-command-result "{(+ 1 2)} 3") 3)))
91
92(ert-deftest eshell-test/pipe-headproc () 39(ert-deftest eshell-test/pipe-headproc ()
93 "Check that piping a non-process to a process command waits for the process" 40 "Check that piping a non-process to a process command waits for the process"
94 (skip-unless (executable-find "cat")) 41 (skip-unless (executable-find "cat"))