Skip to content

Commit

Permalink
Add clojure test
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 6, 2023
1 parent 09f2e1d commit 1200c3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/squint/compiler_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[babashka.process :refer [sh] :as p]
[clojure.string :as str]
[clojure.test :refer [deftest is] :as t]
[clojure.edn :as edn]
[squint.compiler :as sq]))

(defn to-js [code {:keys [requires]}]
Expand All @@ -25,7 +26,10 @@
(is (str/includes? (test-expr "(prn (+ 1 2 3))")
"6"))
(is (str/includes? (test-expr "(ns foo (:require [\"fs\" :as fs])) (prn (fs/existsSync \".\"))")
"true")))
"true"))
(is (= [0 1 2 3 4 5 6 7 8 9]
(edn/read-string
(format "[%s]" (test-expr "(vec (for [i (range 10)] (println i)))"))))))

(def our-ns *ns*)
(defn run-tests [_]
Expand Down

0 comments on commit 1200c3e

Please sign in to comment.