File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 1+ ; Copyright (c) Rich Hickey. All rights reserved.
2+ ; The use and distribution terms for this software are covered by the
3+ ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
4+ ; which can be found in the file epl-v10.html at the root of this distribution.
5+ ; By using this software in any fashion, you are agreeing to be bound by
6+ ; the terms of this license.
7+ ; You must not remove this notice, or any other, from this software.
8+
9+ (ns cljs.proxy-test
10+ (:refer-global :only [Object])
11+ (:require [cljs.test :as test :refer-macros [deftest testing is are]]
12+ [cljs.proxy :refer [builder]]
13+ [goog.object :as gobj]))
14+
15+ (def proxy (builder ))
16+
17+ (deftest map-proxy
18+ (let [proxied (proxy {:foo 1 :bar 2 })]
19+ (is (== 1 (gobj/get proxied " foo" )))
20+ (is (== 2 (gobj/get proxied " bar" )))
21+ (is (= [" foo" " bar" ] (seq (Object/keys proxied))))))
22+
23+ (deftest vector-proxy
24+ (let [proxied (proxy [1 2 3 4 ])]
25+ (is (== 4 (alength proxied)))
26+ (is (== 1 (aget proxied 0 )))
27+ (is (== 4 (aget proxied 3 )))))
28+
29+ (comment
30+
31+ (test/run-tests )
32+
33+ )
Original file line number Diff line number Diff line change 6262 [cljs.repl-test]
6363 [cljs.lite-collections-test]
6464 [cljs.extend-to-native-test]
65- [cljs.var-test]))
65+ [cljs.var-test]
66+ [cljs.proxy-test]))
6667
6768(set! *print-newline* false )
6869
124125 'cljs.lite-collections-test
125126 'cljs.extend-to-native-test
126127 'cljs.var-test
128+ 'cljs.proxy-test
127129 )
Original file line number Diff line number Diff line change 6161 [cljs.walk-test]
6262 [cljs.repl-test]
6363 [cljs.extend-to-native-test]
64- [cljs.var-test]))
64+ [cljs.var-test]
65+ [cljs.proxy-test]))
6566
6667(set! *print-newline* false )
6768
124125 'cljs.walk-test
125126 'cljs.repl-test
126127 'cljs.extend-to-native-test
127- 'cljs.var-test)
128+ 'cljs.var-test
129+ 'cljs.proxy-test)
You can’t perform that action at this time.
0 commit comments