|
27 | 27 | (is (= true
|
28 | 28 | (:result (ast (do (ns foo) (= 1 1))))))
|
29 | 29 | (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")))))))) |
31 | 32 | (is (= 2 (:result (ast (#(inc %) 1)))))
|
32 | 33 | #_
|
33 | 34 | (is (->
|
34 | 35 | (ast (do (ns bar
|
35 | 36 | (:require [typed.clojure :as t]))
|
36 | 37 | (t/ann-form 'foo 'a)))
|
37 | 38 | :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))))) |
40 | 45 | (is (= [:const clojure.lang.Compiler]
|
41 | 46 | ((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))))) |
44 | 54 | )
|
45 | 55 |
|
46 | 56 | (deftest local-tag-test
|
47 |
| - (is (= java.lang.String |
| 57 | + (is (= #?(:cljr System.String :default java.lang.String) |
48 | 58 | (:tag (ast "asdf"))))
|
49 |
| - (is (= [:const java.lang.String] |
| 59 | + (is (= [:const #?(:cljr System.String :default java.lang.String)] |
50 | 60 | (-> (ast (let [a "asdf"]))
|
51 | 61 | :bindings
|
52 | 62 | first
|
53 | 63 | :init
|
54 | 64 | ((juxt :op :tag)))))
|
55 |
| - (is (= [:binding java.lang.String] |
| 65 | + (is (= [:binding #?(:cljr System.String :default java.lang.String)] |
56 | 66 | (-> (ast (let [a "asdf"]))
|
57 | 67 | :bindings
|
58 | 68 | first
|
59 | 69 | ((juxt :op :tag)))))
|
60 |
| - (is (= [:local java.lang.String] |
| 70 | + (is (= [:local #?(:cljr System.String :default java.lang.String)] |
61 | 71 | (-> (ast (let [a "asdf"]
|
62 | 72 | a))
|
63 | 73 | :body
|
64 | 74 | :ret
|
65 | 75 | ((juxt :op :tag)))))
|
66 |
| - (is (= java.lang.String |
| 76 | + (is (= #?(:cljr System.String :default java.lang.String) |
67 | 77 | (:tag (ast (let [a "asdf"]
|
68 | 78 | a)))))
|
69 | 79 | )
|
|
75 | 85 | (ast
|
76 | 86 | (deftype A []
|
77 | 87 | Object
|
78 |
| - (toString [_] (A.) "a"))))))) |
| 88 | + (#?(:cljr ToString :default toString) [_] (A.) "a"))))))) |
79 | 89 |
|
80 | 90 | (deftest uniquify-test
|
81 | 91 | (let [ret (ast' (let [a 1]
|
|
0 commit comments