   (checking
    "Multiple segments can be returned, attached to their root"
    (times 30)
-   [input (gen/hash-map :message (gen/map gen/any gen/any))
+   [input (gen-segment)
     output (gen/vector (gen/map gen/any gen/any))]
    (let [f (fn [segment] output)
          event {:onyx.core/batch [input]}

     (is (= input (map :root tree)))
     (is (every? #(= clojure.lang.ExceptionInfo (type %)) messages))
     (is (every? #(= {:val 42} (ex-data (:exception %))) (map ex-data messages))))))

  (checking
   "Functions can be parameterized via the event map"
   (times 30)
   [input (gen/vector (gen-segment))
    params (gen/vector gen/any)]
   (let [f (fn [& args] {:result (or (butlast args) [])})
         event {:onyx.core/batch input :onyx.core/params params}
