diff options
| author | Philipp Stephani | 2020-04-12 19:04:11 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2020-04-12 19:04:11 +0200 |
| commit | 42306747d8dece897805e89c36c3741bfb8d5e7c (patch) | |
| tree | 0181f51f2985593c4db442a284db582fb9eca554 /test/src | |
| parent | 900947fbe8b202ce2ae15e87ef377ca27da73ec9 (diff) | |
| download | emacs-42306747d8dece897805e89c36c3741bfb8d5e7c.tar.gz emacs-42306747d8dece897805e89c36c3741bfb8d5e7c.zip | |
Fix error in 'call-process-region' when START is nil (Bug#40576)
* src/callproc.c (Fcall_process_region): Fix behavior when START is
nil and DELETE is non-nil.
* test/src/callproc-tests.el
(call-process-region-entire-buffer-with-delete): New unit test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/callproc-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/callproc-tests.el b/test/src/callproc-tests.el index bf7d47b27f1..1617d5e33d3 100644 --- a/test/src/callproc-tests.el +++ b/test/src/callproc-tests.el | |||
| @@ -66,4 +66,14 @@ | |||
| 66 | (error :got-error)))) | 66 | (error :got-error)))) |
| 67 | (should have-called-debugger))) | 67 | (should have-called-debugger))) |
| 68 | 68 | ||
| 69 | (ert-deftest call-process-region-entire-buffer-with-delete () | ||
| 70 | "Check that Bug#40576 is fixed." | ||
| 71 | (let ((emacs (expand-file-name invocation-name invocation-directory))) | ||
| 72 | (skip-unless (file-executable-p emacs)) | ||
| 73 | (with-temp-buffer | ||
| 74 | (insert "Buffer contents\n") | ||
| 75 | (should | ||
| 76 | (eq (call-process-region nil nil emacs :delete nil nil "--version") 0)) | ||
| 77 | (should (eq (buffer-size) 0))))) | ||
| 78 | |||
| 69 | ;;; callproc-tests.el ends here | 79 | ;;; callproc-tests.el ends here |