branch: externals/el-job
commit 1932e031818135ddb4624777f3184ea974354e01
Author: Martin Edström <[email protected]>
Commit: Martin Edström <[email protected]>

    Fix order of items and add a test
---
 el-job-ng.el   |  3 ++-
 el-job-test.el | 30 ++++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/el-job-ng.el b/el-job-ng.el
index 0a9c545331..57bd72072a 100644
--- a/el-job-ng.el
+++ b/el-job-ng.el
@@ -280,7 +280,8 @@ ID can also be passed to these helpers:
             ;; https://github.com/meedstrom/org-node/issues/75
             (( file-error )
              (el-job-ng-kill-keep-bufs id)
-             (el-job-ng--dbg 1 "Terminated because of: %S" err))))))))
+             (el-job-ng--dbg 1 "Terminated because of: %S" err)))
+          (setf process-outputs (nreverse process-outputs)))))))
 
 
 ;;; Code used by child processes
diff --git a/el-job-test.el b/el-job-test.el
index abd40f3b8a..c9b40848e7 100644
--- a/el-job-test.el
+++ b/el-job-test.el
@@ -21,8 +21,34 @@
 (require 'map)
 (require 'subr-x)
 (require 'cl-lib)
-(require 'el-job-old-child)
-(require 'el-job-old)
+(require 'el-job)
+
+(ert-deftest preserves-order-of-elements ()
+  (let ((nonsense '("foo" "bar" "baz"
+                    "qux" "quux" "quuux" "quuuux"
+                    "bazola" "ztesch"
+                    "foo" "bar" "thud" "grunt"
+                    "foo" "bar" "bletch"
+                    "foo" "bar" "fum"
+                    "fred" "jim" "sheila" "barney"
+                    "flarp"
+                    "xyzzy"
+                    "fnord"
+                    "zxc" "spqr" "wombat"
+                    "shme"
+                    "foo" "bar" "baz" "bongo"
+                    "spam" "eggs"
+                    "snork"
+                    "foo" "bar" "zot"
+                    "blarg" "wibble"
+                    "toto" "titi" "tata" "tutu"
+                    "pippo" "pluto" "paperino"
+                    "aap" "noot" "mies"
+                    "oogle" "foogle" "boogle"
+                    "zork" "gork" "bork")))
+    (equal (mapcar #'upcase nonsense)
+           (el-job-parallel-mapcar #'upcase nonsense))))
+
 
 (ert-deftest el-job-old--split-optimally ()
   ;; All benchmarks at zero

Reply via email to