diff --git a/src/test/cljs/cljs/lite_collections_test.cljs b/src/test/cljs/cljs/lite_collections_test.cljs index 99cb2be29..56d44d0eb 100644 --- a/src/test/cljs/cljs/lite_collections_test.cljs +++ b/src/test/cljs/cljs/lite_collections_test.cljs @@ -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)])))) diff --git a/src/test/cljs/cljs/proxy_test.cljs b/src/test/cljs/cljs/proxy_test.cljs new file mode 100644 index 000000000..36b53d7cd --- /dev/null +++ b/src/test/cljs/cljs/proxy_test.cljs @@ -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) + +) diff --git a/src/test/cljs/lite_test_runner.cljs b/src/test/cljs/lite_test_runner.cljs index 95313b3f8..0b0c45b56 100644 --- a/src/test/cljs/lite_test_runner.cljs +++ b/src/test/cljs/lite_test_runner.cljs @@ -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] @@ -72,6 +73,7 @@ (enable-console-print!)) (run-tests + 'cljs.proxy-test 'cljs.apply-test 'cljs.primitives-test 'cljs.destructuring-test @@ -123,5 +125,4 @@ 'cljs.repl-test 'cljs.lite-collections-test 'cljs.extend-to-native-test - 'cljs.var-test - ) + 'cljs.var-test) diff --git a/src/test/cljs/test_runner.cljs b/src/test/cljs/test_runner.cljs index 7e551f9de..16a1cbf18 100644 --- a/src/test/cljs/test_runner.cljs +++ b/src/test/cljs/test_runner.cljs @@ -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] @@ -71,6 +72,7 @@ (enable-console-print!)) (run-tests + 'cljs.proxy-test 'cljs.apply-test 'cljs.primitives-test 'cljs.destructuring-test