Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/test/cljs/cljs/lite_collections_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
(deftest test-set-lite-with-set
(is (= (set-lite []) (set [])))
(is (= (set []) (set-lite [])))
(is (= (set-lite ["foo" "bar"]) (set-lite ["foo" "bar"])))
(is (= (set-lite ["foo" "bar"]) (set-lite #js ["foo" "bar"])))
(is (= (set-lite [(MapEntry. 1 2 nil)])
(set [(MapEntry. 1 2 nil)]))))

Expand Down
33 changes: 33 additions & 0 deletions src/test/cljs/cljs/proxy_test.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.

(ns cljs.proxy-test
(:refer-global :only [Object])
(:require [cljs.test :as test :refer-macros [deftest testing is are]]
[cljs.proxy :refer [builder]]
[goog.object :as gobj]))

(def proxy (builder))

(deftest map-proxy
(let [proxied (proxy {:foo 1 :bar 2})]
(is (== 1 (gobj/get proxied "foo")))
(is (== 2 (gobj/get proxied "bar")))
(is (= #{"foo" "bar"} (into #{} (Object/keys proxied))))))

(deftest vector-proxy
(let [proxied (proxy [1 2 3 4])]
(is (== 4 (alength proxied)))
(is (== 1 (aget proxied 0)))
(is (== 4 (aget proxied 3)))))

(comment

(test/run-tests)

)
7 changes: 4 additions & 3 deletions src/test/cljs/lite_test_runner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
;; You must not remove this notice, or any other, from this software.

(ns lite-test-runner
(:require [cljs.test :refer-macros [run-tests]]
(:require [cljs.proxy-test]
[cljs.test :refer-macros [run-tests]]
[cljs.apply-test]
[cljs.primitives-test]
[cljs.destructuring-test]
Expand Down Expand Up @@ -72,6 +73,7 @@
(enable-console-print!))

(run-tests
'cljs.proxy-test
'cljs.apply-test
'cljs.primitives-test
'cljs.destructuring-test
Expand Down Expand Up @@ -123,5 +125,4 @@
'cljs.repl-test
'cljs.lite-collections-test
'cljs.extend-to-native-test
'cljs.var-test
)
'cljs.var-test)
4 changes: 3 additions & 1 deletion src/test/cljs/test_runner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
;; You must not remove this notice, or any other, from this software.

(ns test-runner
(:require [cljs.test :refer-macros [run-tests]]
(:require [cljs.proxy-test]
[cljs.test :refer-macros [run-tests]]
[cljs.apply-test]
[cljs.primitives-test]
[cljs.destructuring-test]
Expand Down Expand Up @@ -71,6 +72,7 @@
(enable-console-print!))

(run-tests
'cljs.proxy-test
'cljs.apply-test
'cljs.primitives-test
'cljs.destructuring-test
Expand Down
Loading