|
759 | 759 | (build/build (build/inputs (io/file inputs "trivial/core4.cljs")) opts cenv)
|
760 | 760 | (is (< (.length out-file) 32768))))
|
761 | 761 |
|
| 762 | +(deftest lite-mode-vector-code-size-ratchet |
| 763 | + (testing ":lite-mode + :elide-to-string, should cut output size for [] in 1/2" |
| 764 | + (let [out (.getPath (io/file (test/tmp-dir) "trivial-output-vector-test-out")) |
| 765 | + out-file (io/file out "main.js") |
| 766 | + {:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build")) |
| 767 | + :opts {:main 'trivial.core4 |
| 768 | + :output-dir out |
| 769 | + :output-to (.getPath out-file) |
| 770 | + :lite-mode true |
| 771 | + :elide-to-string true |
| 772 | + :optimizations :advanced}} |
| 773 | + cenv (env/default-compiler-env)] |
| 774 | + (test/delete-out-files out) |
| 775 | + (build/build (build/inputs (io/file inputs "trivial/core4.cljs")) opts cenv) |
| 776 | + (is (< (.length out-file) 16384))))) |
| 777 | + |
762 | 778 | (deftest trivial-output-size-map
|
763 | 779 | (let [out (.getPath (io/file (test/tmp-dir) "trivial-output-map-test-out"))
|
764 | 780 | out-file (io/file out "main.js")
|
|
772 | 788 | (build/build (build/inputs (io/file inputs "trivial/core5.cljs")) opts cenv)
|
773 | 789 | (is (< (.length out-file) 92160))))
|
774 | 790 |
|
| 791 | +(deftest lite-mode-map-code-size-ratchet |
| 792 | + (testing ":lite-mode + :elide-to-string, should cut output size for {} in 1/3" |
| 793 | + (let [out (.getPath (io/file (test/tmp-dir) "trivial-output-map-test-out")) |
| 794 | + out-file (io/file out "main.js") |
| 795 | + {:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build")) |
| 796 | + :opts {:main 'trivial.core5 |
| 797 | + :output-dir out |
| 798 | + :output-to (.getPath out-file) |
| 799 | + :lite-mode true |
| 800 | + :elide-to-string true |
| 801 | + :optimizations :advanced}} |
| 802 | + cenv (env/default-compiler-env)] |
| 803 | + (test/delete-out-files out) |
| 804 | + (build/build (build/inputs (io/file inputs "trivial/core5.cljs")) opts cenv) |
| 805 | + (is (< (.length out-file) 32768))))) |
| 806 | + |
775 | 807 | (deftest cljs-3255-nil-inputs-build
|
776 | 808 | (let [out (.getPath (io/file (test/tmp-dir) "3255-test-out"))
|
777 | 809 | out-file (io/file out "main.js")
|
|
0 commit comments