Skip to content

Commit 573323e

Browse files
author
dnolen
committed
Merge branch 'master' into read-cond
2 parents 44c7be2 + 28f02a4 commit 573323e

File tree

1 file changed

+81
-74
lines changed

1 file changed

+81
-74
lines changed

test/clj/cljs/analyzer_tests.clj

Lines changed: 81 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -155,53 +155,58 @@
155155
'any)))
156156

157157
(deftest fn-inference
158-
(is (= (e/with-compiler-env test-cenv
159-
(:tag (a/analyze test-env
160-
'(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
161-
(x :one)))))
162-
'number))
163-
(is (= (e/with-compiler-env test-cenv
164-
(:tag (a/analyze test-env
165-
'(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
166-
(x :one :two)))))
167-
'string))
168-
(is (= (e/with-compiler-env test-cenv
169-
(:tag (a/analyze test-env
170-
'(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
171-
(x :one :two :three)))))
172-
'cljs.core/IList)))
158+
;(is (= (e/with-compiler-env test-cenv
159+
; (:tag (a/analyze test-env
160+
; '(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
161+
; (x :one)))))
162+
; 'number))
163+
;(is (= (e/with-compiler-env test-cenv
164+
; (:tag (a/analyze test-env
165+
; '(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
166+
; (x :one :two)))))
167+
; 'string))
168+
;(is (= (e/with-compiler-env test-cenv
169+
; (:tag (a/analyze test-env
170+
; '(let [x (fn ([a] 1) ([a b] "foo") ([a b & r] ()))]
171+
; (x :one :two :three)))))
172+
; 'cljs.core/IList))
173+
)
173174

174175
(deftest lib-inference
175176
(is (= (e/with-compiler-env test-cenv
176177
(:tag (a/analyze test-env '(+ 1 2))))
177178
'number))
178-
(is (= (e/with-compiler-env test-cenv
179-
(:tag (a/analyze test-env '(alength (array)))))
180-
'number))
181-
(is (= (e/with-compiler-env test-cenv
182-
(:tag (a/analyze test-env '(aclone (array)))))
183-
'array))
184-
(is (= (e/with-compiler-env test-cenv
185-
(:tag (a/analyze test-env '(count [1 2 3]))))
186-
'number))
187-
(is (= (e/with-compiler-env test-cenv
188-
(:tag (a/analyze test-env '(into-array [1 2 3]))))
189-
'array))
190-
(is (= (e/with-compiler-env test-cenv
191-
(:tag (a/analyze test-env '(js-obj))))
192-
'object))
193-
(is (= (e/with-compiler-env test-cenv
194-
(:tag (a/analyze test-env '(-conj [] 1))))
195-
'clj))
196-
(is (= (e/with-compiler-env test-cenv
197-
(:tag (a/analyze test-env '(conj [] 1))))
198-
'clj))
199-
(is (= (e/with-compiler-env test-cenv
200-
(:tag (a/analyze test-env '(assoc nil :foo :bar))))
201-
'clj))
202-
(is (= (e/with-compiler-env test-cenv
203-
(:tag (a/analyze test-env '(dissoc {:foo :bar} :foo))))
204-
'#{clj clj-nil})))
179+
;(is (= (e/with-compiler-env test-cenv
180+
; (:tag (a/analyze test-env '(alength (array)))))
181+
; 'number))
182+
;(is (= (e/with-compiler-env test-cenv
183+
; (:tag (a/analyze test-env '(aclone (array)))))
184+
; 'array))
185+
;(is (= (e/with-compiler-env test-cenv
186+
; (:tag (a/analyze test-env '(-count [1 2 3]))))
187+
; 'number))
188+
;(is (= (e/with-compiler-env test-cenv
189+
; (:tag (a/analyze test-env '(count [1 2 3]))))
190+
; 'number))
191+
;(is (= (e/with-compiler-env test-cenv
192+
; (:tag (a/analyze test-env '(into-array [1 2 3]))))
193+
; 'array))
194+
;(is (= (e/with-compiler-env test-cenv
195+
; (:tag (a/analyze test-env '(js-obj))))
196+
; 'object))
197+
;(is (= (e/with-compiler-env test-cenv
198+
; (:tag (a/analyze test-env '(-conj [] 1))))
199+
; 'clj))
200+
;(is (= (e/with-compiler-env test-cenv
201+
; (:tag (a/analyze test-env '(conj [] 1))))
202+
; 'clj))
203+
;(is (= (e/with-compiler-env test-cenv
204+
; (:tag (a/analyze test-env '(assoc nil :foo :bar))))
205+
; 'clj))
206+
;(is (= (e/with-compiler-env test-cenv
207+
; (:tag (a/analyze test-env '(dissoc {:foo :bar} :foo))))
208+
; '#{clj clj-nil}))
209+
)
205210

206211
(deftest test-always-true-if
207212
(is (= (e/with-compiler-env test-cenv
@@ -210,39 +215,41 @@
210215

211216
;; will only work if the previous test works
212217
(deftest test-count
213-
(is (= (cljs.env/with-compiler-env test-cenv
214-
(:tag (a/analyze test-env '(count []))))
215-
'number)))
218+
;(is (= (cljs.env/with-compiler-env test-cenv
219+
; (:tag (a/analyze test-env '(count []))))
220+
; 'number))
221+
)
216222

217223
(deftest test-numeric
218-
(is (= (a/no-warn
219-
(cljs.env/with-compiler-env test-cenv
220-
(:tag (a/analyze test-env '(dec x)))))
221-
'number))
222-
(is (= (a/no-warn
223-
(cljs.env/with-compiler-env test-cenv
224-
(:tag (a/analyze test-env '(int x)))))
225-
'number))
226-
(is (= (a/no-warn
227-
(cljs.env/with-compiler-env test-cenv
228-
(:tag (a/analyze test-env '(unchecked-int x)))))
229-
'number))
230-
(is (= (a/no-warn
231-
(cljs.env/with-compiler-env test-cenv
232-
(:tag (a/analyze test-env '(mod x y)))))
233-
'number))
234-
(is (= (a/no-warn
235-
(cljs.env/with-compiler-env test-cenv
236-
(:tag (a/analyze test-env '(quot x y)))))
237-
'number))
238-
(is (= (a/no-warn
239-
(cljs.env/with-compiler-env test-cenv
240-
(:tag (a/analyze test-env '(rem x y)))))
241-
'number))
242-
(is (= (a/no-warn
243-
(cljs.env/with-compiler-env test-cenv
244-
(:tag (a/analyze test-env '(bit-count n)))))
245-
'number)))
224+
;(is (= (a/no-warn
225+
; (cljs.env/with-compiler-env test-cenv
226+
; (:tag (a/analyze test-env '(dec x)))))
227+
; 'number))
228+
;(is (= (a/no-warn
229+
; (cljs.env/with-compiler-env test-cenv
230+
; (:tag (a/analyze test-env '(int x)))))
231+
; 'number))
232+
;(is (= (a/no-warn
233+
; (cljs.env/with-compiler-env test-cenv
234+
; (:tag (a/analyze test-env '(unchecked-int x)))))
235+
; 'number))
236+
;(is (= (a/no-warn
237+
; (cljs.env/with-compiler-env test-cenv
238+
; (:tag (a/analyze test-env '(mod x y)))))
239+
; 'number))
240+
;(is (= (a/no-warn
241+
; (cljs.env/with-compiler-env test-cenv
242+
; (:tag (a/analyze test-env '(quot x y)))))
243+
; 'number))
244+
;(is (= (a/no-warn
245+
; (cljs.env/with-compiler-env test-cenv
246+
; (:tag (a/analyze test-env '(rem x y)))))
247+
; 'number))
248+
;(is (= (a/no-warn
249+
; (cljs.env/with-compiler-env test-cenv
250+
; (:tag (a/analyze test-env '(bit-count n)))))
251+
; 'number))
252+
)
246253

247254
;; =============================================================================
248255
;; Catching errors during macroexpansion
@@ -253,7 +260,7 @@
253260
(a/analyze test-env '(defn foo 123))
254261
(catch Exception e
255262
(.getMessage e)))
256-
"Parameter declaration 123 should be a vector at line")))
263+
"Parameter declaration \"123\" should be a vector at line")))
257264

258265
;; =============================================================================
259266
;; ns desugaring

0 commit comments

Comments
 (0)