Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion boot/pod/src/boot/pod.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require
[clojure.set :as set]
[clojure.string :as string]
[clojure.walk :as walk]
[boot.util :as util]
[boot.file :as file]
[boot.xform :as xf]
Expand Down Expand Up @@ -465,7 +466,9 @@
([expr]
(let [{:keys [meta? expr]} (read-string expr)]
(binding [*print-meta* meta?]
(pr-str (eval expr)))))
(->> (eval expr)
(walk/postwalk identity) ; make sure all lazy seqs are realized #683
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(pr-str)))))
([pod expr]
(let [arg (pr-str {:meta? *print-meta* :expr expr})
ret (with-invoke-in pod (boot.pod/eval-in* arg))]
Expand Down
8 changes: 8 additions & 0 deletions boot/pod/test/boot/pod_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@

))

(deftest lazy-pod-return-value-test-683
(testing "println inside lazy seqs does not end up in return value"
(let [data (range 400)
expected (map #(do (println %) %) data)
pod-result (boot.pod/with-eval-in (boot.pod/make-pod {})
(map #(do (println %) %) ~data))]
(= data pod-result))))

(deftest canonical
(testing "boot.pod/canonical-id"
(is (= 'foo (pod/canonical-id 'foo)) "In case there is no group, return artifact")
Expand Down