From 5842ea818f42c3bbeae1125ab526e071a6fe75ce Mon Sep 17 00:00:00 2001 From: xificurC Date: Wed, 31 Jan 2024 15:56:52 +0100 Subject: [PATCH] fix electric test shim --- src/hyperfiddle/electric_local_def_de.cljc | 2 +- test/hyperfiddle/electric_de_test.cljc | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hyperfiddle/electric_local_def_de.cljc b/src/hyperfiddle/electric_local_def_de.cljc index 04d9d5723..6b1c62c1e 100644 --- a/src/hyperfiddle/electric_local_def_de.cljc +++ b/src/hyperfiddle/electric_local_def_de.cljc @@ -27,5 +27,5 @@ #?(:clj (defn run-single [frame] (m/reduce #(do %2) nil frame))) #?(:clj (defmacro single {:style/indent 0} [conf & body] (ca/check map? conf) - (let [env (merge (->local-config (lang/normalize-env &env)) conf)] + (let [env (merge (->local-config &env) (lang/normalize-env &env) conf)] `(run-single (r/root-frame {::Main ~(lang/compile ::Main `(do ~@body) env)} ::Main))))) diff --git a/test/hyperfiddle/electric_de_test.cljc b/test/hyperfiddle/electric_de_test.cljc index 409658906..287ef4f1f 100644 --- a/test/hyperfiddle/electric_de_test.cljc +++ b/test/hyperfiddle/electric_de_test.cljc @@ -2,13 +2,6 @@ (:require [hyperfiddle.rcf :as rcf :refer [tests tap with %]] [hyperfiddle.electric-local-def-de :as l])) -;; fails to compile, rcf rewrites `tap` to `RCF__tap` and electric compiler fails to resolve that -;; (tests "hello world" -;; (with ((l/single {} (tap "hello world")) tap tap) -;; % := "hello world")) - -(def hello (l/single {} (tap "hello world"))) (tests "hello world" - (with (hello tap tap) - % := "hello world" ; returns a diff {:degree 1, :permutation {}, :grow 1, :shrink 0, :change {0 "hello world"}, :freeze #{0}} - )) + (with ((l/single {} (tap "hello world")) tap tap) + % := "hello world"))