Skip to content

Commit eba23cb

Browse files
committed
only jvm
1 parent bbe159a commit eba23cb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/sci/interop_test.cljc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,13 @@
333333
#?(:cljs (deftest local-interop-test
334334
(is (= 1 (tu/eval* "(let [j #js {:a (fn [] 1)}] (j.a))" nil)))))
335335

336-
(deftest type-hint-test
337-
(testing "string type hints"
338-
(is (string? (sci/eval-string "(defn read-string [^\"[B\" v] (String. v)) (read-string \"1\")"))))
339-
(testing "type hinting with runnable returns nil on futuretask get"
340-
#?(:clj
336+
#?(:clj
337+
(deftest type-hint-test
338+
(testing "string type hints"
339+
(is (string? (sci/eval-string "(defn read-string [^\"[B\" v] (String. v)) (read-string \"1\")"))))
340+
(testing "type hinting with runnable returns nil on futuretask get"
341341
(let [config {:classes {'java.util.concurrent.Executors java.util.concurrent.Executors 'java.util.concurrent.ThreadPoolExecutor java.util.concurrent.ThreadPoolExecutor 'java.util.concurrent.Callable java.util.concurrent.Callable 'java.util.concurrent.FutureTask java.util.concurrent.FutureTask 'java.lang.Runnable java.lang.Runnable}}]
342-
(is (nil? (sci/eval-string "(def fut (let [^java.lang.Runnable f (fn [] 3)] (.submit (java.util.concurrent.Executors/newCachedThreadPool) f))) (.get fut)" config))))))
343-
(testing "type hinting with callable returns nil on futuretask get"
344-
#?(:clj
342+
(is (nil? (sci/eval-string "(def fut (let [^java.lang.Runnable f (fn [] 3)] (.submit (java.util.concurrent.Executors/newCachedThreadPool) f))) (.get fut)" config)))))
343+
(testing "type hinting with callable returns nil on futuretask get"
345344
(let [config {:classes {'java.util.concurrent.Executors java.util.concurrent.Executors 'java.util.concurrent.ThreadPoolExecutor java.util.concurrent.ThreadPoolExecutor 'java.util.concurrent.Callable java.util.concurrent.Callable 'java.util.concurrent.FutureTask java.util.concurrent.FutureTask 'java.lang.Runnable java.lang.Runnable}}]
346345
(is (= 3 (sci/eval-string "(def fut (let [^java.util.concurrent.Callable f (fn [] 3)] (.submit (java.util.concurrent.Executors/newCachedThreadPool) f))) (.get fut)" config)))))))

0 commit comments

Comments
 (0)