Skip to content

Commit 60b0919

Browse files
committed
(WIP) conditionalizing tests for ClojureCLR -- remembered to save the file this time
1 parent 7609f23 commit 60b0919

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

typed/clj.analyzer/test/typed_test/clj/analyzer.cljc

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,53 @@
2727
(is (= true
2828
(:result (ast (do (ns foo) (= 1 1))))))
2929
(is (= "a"
30-
(:result (ast (.toString (reify Object (toString [this] "a")))))))
30+
(:result (ast #?(:cljr (.ToString (reify Object (ToString [this] "a")))
31+
:default (.toString (reify Object (toString [this] "a"))))))))
3132
(is (= 2 (:result (ast (#(inc %) 1)))))
3233
#_
3334
(is (->
3435
(ast (do (ns bar
3536
(:require [typed.clojure :as t]))
3637
(t/ann-form 'foo 'a)))
3738
:ret))
38-
(is (= [:const Number]
39-
((juxt :op :val) (ast Number))))
39+
#?(:cljr
40+
(is (= [:const Int64]
41+
((juxt :op :val) (ast Int64))))
42+
:default
43+
(is (= [:const Number]
44+
((juxt :op :val) (ast Number)))))
4045
(is (= [:const clojure.lang.Compiler]
4146
((juxt :op :val) (ast clojure.lang.Compiler))))
42-
(is (= [:static-field 'LOADER]
43-
((juxt :op :field) (ast clojure.lang.Compiler/LOADER))))
47+
48+
#?(:cljr
49+
(is (= [:static-field 'specials]
50+
((juxt :op :field) (ast clojure.lang.Compiler/specials))))
51+
:default
52+
(is (= [:static-field 'LOADER]
53+
((juxt :op :field) (ast clojure.lang.Compiler/LOADER)))))
4454
)
4555

4656
(deftest local-tag-test
47-
(is (= java.lang.String
57+
(is (= #?(:cljr System.String :default java.lang.String)
4858
(:tag (ast "asdf"))))
49-
(is (= [:const java.lang.String]
59+
(is (= [:const #?(:cljr System.String :default java.lang.String)]
5060
(-> (ast (let [a "asdf"]))
5161
:bindings
5262
first
5363
:init
5464
((juxt :op :tag)))))
55-
(is (= [:binding java.lang.String]
65+
(is (= [:binding #?(:cljr System.String :default java.lang.String)]
5666
(-> (ast (let [a "asdf"]))
5767
:bindings
5868
first
5969
((juxt :op :tag)))))
60-
(is (= [:local java.lang.String]
70+
(is (= [:local #?(:cljr System.String :default java.lang.String)]
6171
(-> (ast (let [a "asdf"]
6272
a))
6373
:body
6474
:ret
6575
((juxt :op :tag)))))
66-
(is (= java.lang.String
76+
(is (= #?(:cljr System.String :default java.lang.String)
6777
(:tag (ast (let [a "asdf"]
6878
a)))))
6979
)
@@ -75,7 +85,7 @@
7585
(ast
7686
(deftype A []
7787
Object
78-
(toString [_] (A.) "a")))))))
88+
(#?(:cljr ToString :default toString) [_] (A.) "a")))))))
7989

8090
(deftest uniquify-test
8191
(let [ret (ast' (let [a 1]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy