aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorJim Porter2023-09-06 17:00:59 -0700
committerJim Porter2023-09-10 10:38:25 -0700
commite554ee0b5f77a3b6fe70e7a4d3d60bf319879aca (patch)
treebf30586f0dfacbc5f17adff991bcae084236f10e /test/lisp/eshell/eshell-tests.el
parentf9667836c4b193d02a375350f4a16e0fe8d8b4f2 (diff)
downloademacs-e554ee0b5f77a3b6fe70e7a4d3d60bf319879aca.tar.gz
emacs-e554ee0b5f77a3b6fe70e7a4d3d60bf319879aca.zip
; Move some Eshell tests to more-topical files
eshell-tests.el should mainly be for code in eshell.el. * test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc) (eshell-test/pipe-tailproc, eshell-test/pipe-subcommand) (eshell-test/pipe-subcommand-with-pipe) (eshell-test/subcommand-reset-in-pipeline) (eshell-test/lisp-reset-in-pipeline): Move to... * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/pipeline-wait/head-proc) (esh-cmd-test/pipeline-wait/tail-proc) (esh-cmd-test/pipeline-wait/subcommand) (esh-cmd-test/pipeline-wait/subcommand-with-pipe) (esh-cmd-test/reset-in-pipeline/subcommand) (esh-cmd-test/reset-in-pipeline/lisp): ... here. * test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc-stdin): Move to... * test/lisp/eshell/esh-io-tests.el (esh-io-test/pipeline/stdin-to-head): ... here.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r--test/lisp/eshell/eshell-tests.el69
1 files changed, 0 insertions, 69 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 46c9482ecf4..777c927c78e 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -38,75 +38,6 @@
38 38
39;;; Tests: 39;;; Tests:
40 40
41(ert-deftest eshell-test/pipe-headproc ()
42 "Check that piping a non-process to a process command waits for the process"
43 (skip-unless (executable-find "cat"))
44 (with-temp-eshell
45 (eshell-match-command-output "echo hi | *cat"
46 "hi")))
47
48(ert-deftest eshell-test/pipe-tailproc ()
49 "Check that piping a process to a non-process command waits for the process"
50 (skip-unless (executable-find "echo"))
51 (with-temp-eshell
52 (eshell-match-command-output "*echo hi | echo bye"
53 "bye\nhi\n")))
54
55(ert-deftest eshell-test/pipe-headproc-stdin ()
56 "Check that standard input is sent to the head process in a pipeline"
57 (skip-unless (and (executable-find "tr")
58 (executable-find "rev")))
59 (with-temp-eshell
60 (eshell-insert-command "tr a-z A-Z | rev")
61 (eshell-insert-command "hello")
62 (eshell-send-eof-to-process)
63 (eshell-wait-for-subprocess)
64 (should (eshell-match-output "OLLEH\n"))))
65
66(ert-deftest eshell-test/pipe-subcommand ()
67 "Check that piping with an asynchronous subcommand works"
68 (skip-unless (and (executable-find "echo")
69 (executable-find "cat")))
70 (with-temp-eshell
71 (eshell-match-command-output "echo ${*echo hi} | *cat"
72 "hi")))
73
74(ert-deftest eshell-test/pipe-subcommand-with-pipe ()
75 "Check that piping with an asynchronous subcommand with its own pipe works"
76 (skip-unless (and (executable-find "echo")
77 (executable-find "cat")))
78 (with-temp-eshell
79 (eshell-match-command-output "echo ${*echo hi | *cat} | *cat"
80 "hi")))
81
82(ert-deftest eshell-test/subcommand-reset-in-pipeline ()
83 "Check that subcommands reset `eshell-in-pipeline-p'."
84 (skip-unless (executable-find "cat"))
85 (dolist (template '("echo {%s} | *cat"
86 "echo ${%s} | *cat"
87 "*cat $<%s> | *cat"))
88 (eshell-command-result-equal
89 (format template "echo $eshell-in-pipeline-p")
90 nil)
91 (eshell-command-result-equal
92 (format template "echo | echo $eshell-in-pipeline-p")
93 "last")
94 (eshell-command-result-equal
95 (format template "echo $eshell-in-pipeline-p | echo")
96 "first")
97 (eshell-command-result-equal
98 (format template "echo | echo $eshell-in-pipeline-p | echo")
99 "t")))
100
101(ert-deftest eshell-test/lisp-reset-in-pipeline ()
102 "Check that interpolated Lisp forms reset `eshell-in-pipeline-p'."
103 (skip-unless (executable-find "cat"))
104 (dolist (template '("echo (%s) | *cat"
105 "echo $(%s) | *cat"))
106 (eshell-command-result-equal
107 (format template "format \"%s\" eshell-in-pipeline-p")
108 "nil")))
109
110(ert-deftest eshell-test/eshell-command/simple () 41(ert-deftest eshell-test/eshell-command/simple ()
111 "Test that the `eshell-command' function writes to the current buffer." 42 "Test that the `eshell-command' function writes to the current buffer."
112 (skip-unless (executable-find "echo")) 43 (skip-unless (executable-find "echo"))