Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurC committed Aug 22, 2024
1 parent 249c0ca commit 3ab4ca3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/hyperfiddle/electric_de_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,18 @@

#?(:clj
(tests "reactive doto"
(defn MutableMap [] (new java.util.HashMap))
(defn PutMap [!m k v] (.put !m k v))
(defn Ref [] (new Object))
(defn mutable-map [] (new java.util.HashMap))
(defn put-map [!m k v] (.put !m k v))
(defn a-ref [] (new Object))
(def !z (atom 0))
(def !xx (atom 0))
(with ((l/single {}
#_(doto (element "input")
(set-attribute! "type" "text")
(set-attribute! "value" x))
(tap (doto (MutableMap) ; the doto is incrementalized
(PutMap "a" (swap! !z inc)) ; detect effect
(PutMap "b" (tap (e/watch !xx)))))) tap tap)
(tap (doto (mutable-map) ; the doto is incrementalized
(put-map "a" (swap! !z inc)) ; detect effect
(put-map "b" (tap (e/watch !xx)))))) tap tap)
% := 0, % := {"a" 1 "b" 0}
(swap! !xx inc)
% := 1))) ; mutable map is clojure.core/=, therefore skipped
Expand Down Expand Up @@ -2266,10 +2266,10 @@

(e/defn CallMe ([] 0) ([n] n))

(tests
"electric symbolic calling convention"
(tests "electric symbolic calling convention"
(with ((l/single {} (tap (CallMe))) tap tap)
% := 0)
% := 0))

(with ((l/single {::lang/print-expansion true} (tap ($ CallMe 10))) tap tap)
(tests "electric symbolic calling convention"
(with ((l/single {} (tap (CallMe 10))) tap tap)
% := 10))

0 comments on commit 3ab4ca3

Please sign in to comment.