diff --git a/src/leiningen/core.clj b/src/leiningen/core.clj index 2d461d547..2272bfdbd 100644 --- a/src/leiningen/core.clj +++ b/src/leiningen/core.clj @@ -11,7 +11,7 @@ (walk (fn [item] (cond (and (seq? item) (= `unquote (first item))) (second item) ;; needed if we want fn literals to be usable by eval-in-project - (or (list? item) (symbol? item)) (list 'quote item) + (or (seq? item) (symbol? item)) (list 'quote item) :else (unquote-project item))) identity args)) diff --git a/test/test_core.clj b/test/test_core.clj index 324f4ab0d..298e86f6a 100644 --- a/test/test_core.clj +++ b/test/test_core.clj @@ -1,13 +1,7 @@ (ns test-core - (:require leiningen.core :reload-all) + (:use [leiningen.core] :reload-all) (:use [clojure.test])) -;; testing private vars is awesome! - -(def make-groups @#'leiningen.core/make-groups) - -(def matching-arity? @#'leiningen.core/matching-arity?) - (deftest test-make-groups-empty-args (is (= [[]] (make-groups [])))) @@ -37,3 +31,10 @@ (is (matching-arity? "version" nil [])) (is (not (matching-arity? "test" nil []))) (is (not (matching-arity? "test" nil ["test-core"])))) + +(deftest test-unquote + (let [project (binding [*ns* (find-ns 'leiningen.core)] + (read-project "test_projects/sample/project.clj"))] + (is (= ['org.clojure/clojure "1.1.0-master-SNAPSHOT"] + (first (:dependencies project)))) + (is (= '(fn [_] (> (rand) 0.5)))))) diff --git a/test_projects/sample/project.clj b/test_projects/sample/project.clj index 6ba71e47e..11ed09244 100644 --- a/test_projects/sample/project.clj +++ b/test_projects/sample/project.clj @@ -16,4 +16,5 @@ :bin "bin/nom"} :test-selectors {:integration :integration :default (complement :integration) + :random (fn [_] (> (rand) ~(float 1/2))) :all (constantly true)})