From 0f6ea67141c05d8f5e562bcaf880828cc80af80c Mon Sep 17 00:00:00 2001 From: Ben Smith-Mannschott Date: Sat, 15 Oct 2011 18:52:24 +0200 Subject: [PATCH] CLJ-850: add regression test --- src/script/run_tests.clj | 1 + test/clojure/test_clojure/clj_850.clj | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 test/clojure/test_clojure/clj_850.clj diff --git a/src/script/run_tests.clj b/src/script/run_tests.clj index 6720abd..90460b8 100644 --- a/src/script/run_tests.clj +++ b/src/script/run_tests.clj @@ -4,6 +4,7 @@ clojure.test-clojure.agents clojure.test-clojure.annotations clojure.test-clojure.atoms +clojure.test-clojure.clj-850 clojure.test-clojure.clojure-set clojure.test-clojure.clojure-walk clojure.test-clojure.clojure-xml diff --git a/test/clojure/test_clojure/clj_850.clj b/test/clojure/test_clojure/clj_850.clj new file mode 100644 index 0000000..40492e6 --- /dev/null +++ b/test/clojure/test_clojure/clj_850.clj @@ -0,0 +1,33 @@ +; Copyright (c) Rich Hickey. All rights reserved. +; The use and distribution terms for this software are covered by the +; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) +; which can be found in the file epl-v10.html at the root of this distribution. +; By using this software in any fashion, you are agreeing to be bound by +; the terms of this license. +; You must not remove this notice, or any other, from this software. + +(ns clojure.test-clojure.clj-850 + (:use clojure.test clojure.test-helper + clojure.test-clojure.protocols)) + +(deftest clj-850 + (testing "Hinting the arg vector of a primitive-taking fn with a non-primitive type should not result in AbstractMethodError when invoked." + (testing "CLJ-850 is fixed when this case passes." + (is (= "foo" + (eval-in-temp-ns + (defn f ^String [^String s ^long i] s) + (f "foo" 1))))) + (testing "These cases should pass, even without a fix for CLJ-850." + (is (= "foo" + (eval-in-temp-ns + (defn f ^String [^String s] s) + (f "foo")))) + (is (= 1 + (eval-in-temp-ns + (defn f ^long [^String s ^long i] i) + (f "foo" 1)))) + (is (= 1 + (eval-in-temp-ns + (defn f ^long [^long i] i) + (f 1))))))) + -- 1.7.6.1