diff options
author | David Rupp <david@ruppworks.com> | 2010-10-25 22:16:45 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-11-29 20:59:39 -0500 |
commit | 6c6c735c1c3acc3e766ae8919c988a91ec485e32 (patch) | |
tree | 8110d136922586c5eb8b7a9657f845012f91d346 | |
parent | e742a064b0097d16b336bb719eab488f3e5b17ed (diff) |
Fixes that aliasing an unknown namespace gave an unhelpful error; will now throw the same Exception thrown by (the-ns) when the namespace is not found
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r-- | src/clj/clojure/core.clj | 2 | ||||
-rw-r--r-- | test/clojure/test_clojure/ns_libs.clj | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index f5e18bb6..1612e9ec 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -3714,7 +3714,7 @@ {:added "1.0" :static true} [alias namespace-sym] - (.addAlias *ns* alias (find-ns namespace-sym))) + (.addAlias *ns* alias (the-ns namespace-sym))) (defn ns-aliases "Returns a map of the aliases for the namespace." diff --git a/test/clojure/test_clojure/ns_libs.clj b/test/clojure/test_clojure/ns_libs.clj index 37afacb3..ab42f7f8 100644 --- a/test/clojure/test_clojure/ns_libs.clj +++ b/test/clojure/test_clojure/ns_libs.clj @@ -26,6 +26,9 @@ ; require use ; loaded-libs +(deftest test-alias + (is (thrown-with-msg? Exception #"No namespace: epicfail found" (alias 'bogus 'epicfail)))) + (deftest test-require (is (thrown? Exception (require :foo))) (is (thrown? Exception (require)))) |