aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/process-tests.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e83a67290b2..551b34ff371 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -181,6 +181,17 @@
181 (should-not (process-query-on-exit-flag process)))) 181 (should-not (process-query-on-exit-flag process))))
182 (kill-process process))))) 182 (kill-process process)))))
183 183
184;; Return t if OUTPUT could have been generated by merging the INPUTS somehow.
185(defun process-tests--mixable (output &rest inputs)
186 (while (and output (let ((ins inputs))
187 (while (and ins (not (eq (car (car ins)) (car output))))
188 (setq ins (cdr ins)))
189 (if ins
190 (setcar ins (cdr (car ins))))
191 ins))
192 (setq output (cdr output)))
193 (not (apply #'append output inputs)))
194
184(ert-deftest make-process/mix-stderr () 195(ert-deftest make-process/mix-stderr ()
185 "Check that `make-process' mixes the output streams if STDERR is nil." 196 "Check that `make-process' mixes the output streams if STDERR is nil."
186 (skip-unless (executable-find "bash")) 197 (skip-unless (executable-find "bash"))
@@ -200,7 +211,9 @@
200 (accept-process-output process)) 211 (accept-process-output process))
201 (should (eq (process-status process) 'exit)) 212 (should (eq (process-status process) 'exit))
202 (should (eq (process-exit-status process) 0)) 213 (should (eq (process-exit-status process) 0))
203 (should (equal (buffer-string) "stdout\nstderr\n"))))) 214 (should (process-tests--mixable (string-to-list (buffer-string))
215 (string-to-list "stdout\n")
216 (string-to-list "stderr\n"))))))
204 217
205(provide 'process-tests) 218(provide 'process-tests)
206;; process-tests.el ends here. 219;; process-tests.el ends here.