File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 322322 (is (match? {:blocks [{:type :code ,
323323 :result {:nextjournal/value " foo" }}]}
324324 (eval/eval-string " (re-find '#\" foo\" \" foobar\" )" ))))
325+
326+ (deftest issue-781-var-snapshot-test
327+ (let [notebook (fn [cache?]
328+ (format " (ns parsing-extensibility
329+ {:nextjournal.clerk/toc :collapsed
330+ :nextjournal.clerk/no-cache %s}
331+ (:require [nextjournal.clerk :as clerk]))
332+
333+ ^{:nextjournal.clerk/visibility {:code :hide :result :hide}}
334+ (def show-text
335+ {:transform-fn (fn [x] (clerk/html [:pre (:nextjournal/value x)]))})
336+
337+ ^{::clerk/visibility {:code :hide} ::clerk/viewer show-text}
338+ (def x 1)"
339+ (not cache?)))]
340+ (doseq [cache? [true #_false]]
341+ (is (match? {:nextjournal.clerk/var-from-def var?
342+ :nextjournal.clerk/var-snapshot 1 }
343+ (-> (eval/eval-string (notebook cache?))
344+ :blocks last :result :nextjournal/value ))))))
You can’t perform that action at this time.
0 commit comments