Skip to content

Commit 704bec2

Browse files
committed
* add two more trivial output tests
- keyword should be very small - vector by itself should be reasonable
1 parent 9bb3942 commit 704bec2

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(ns trivial.core2)
22

3-
(. js/console (-lookup 1 2))
3+
(.log js/console (-lookup 1 2))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(ns trivial.core3)
2+
3+
(.log js/console :foo)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(ns trivial.core4)
2+
3+
(.log js/console [])

src/test/clojure/cljs/build_api_tests.clj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,32 @@
733733
(build/build (build/inputs (io/file inputs "trivial/core2.cljs")) opts cenv)
734734
(is (< (.length out-file) 10000))))
735735

736+
(deftest trivial-output-size-keyword
737+
(let [out (.getPath (io/file (test/tmp-dir) "trivial-output-keyword-test-out"))
738+
out-file (io/file out "main.js")
739+
{:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build"))
740+
:opts {:main 'trivial.core3
741+
:output-dir out
742+
:output-to (.getPath out-file)
743+
:optimizations :advanced}}
744+
cenv (env/default-compiler-env)]
745+
(test/delete-out-files out)
746+
(build/build (build/inputs (io/file inputs "trivial/core3.cljs")) opts cenv)
747+
(is (< (.length out-file) 10000))))
748+
749+
(deftest trivial-output-size-vector
750+
(let [out (.getPath (io/file (test/tmp-dir) "trivial-output-vector-test-out"))
751+
out-file (io/file out "main.js")
752+
{:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build"))
753+
:opts {:main 'trivial.core4
754+
:output-dir out
755+
:output-to (.getPath out-file)
756+
:optimizations :advanced}}
757+
cenv (env/default-compiler-env)]
758+
(test/delete-out-files out)
759+
(build/build (build/inputs (io/file inputs "trivial/core4.cljs")) opts cenv)
760+
(is (< (.length out-file) 32000))))
761+
736762
(deftest cljs-3255-nil-inputs-build
737763
(let [out (.getPath (io/file (test/tmp-dir) "3255-test-out"))
738764
out-file (io/file out "main.js")

0 commit comments

Comments
 (0)