Skip to content

Commit

Permalink
lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Jul 13, 2023
1 parent 9210e20 commit eb2a37e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion garden.edn
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{:project/id #uuid "64ad48c9-3110-4e31-89be-340e03876734"}
{:project "clerk-session"}
6 changes: 0 additions & 6 deletions src/nextjournal/clerk/session.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
(defn session-ns-name [{:keys [ns session]}]
(symbol (str session-ns-prefix (valuehash session) "." (ns-name ns))))

(defn ->orignal-ns [sym]
(if (qualified-symbol? sym)
(symbol (str/replace (namespace sym) session-ns-pattern "")
(name sym))
sym))

(defn rewrite-ns-form [doc session-ns]
(update-in doc [:blocks 0 :form] (fn [ns-form]
(concat [(first ns-form)
Expand Down
12 changes: 7 additions & 5 deletions test/nextjournal/clerk/eval_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,13 @@
(-> blocks second :result :nextjournal/value :nextjournal.clerk/var-from-def deref))))


(testing "has correct values"
(let [get-values (fn [blocks] (into [] (map (comp :nextjournal/value :result blocks)) [2 4]))
!offset (-> blocks second :result :nextjournal/value :nextjournal.clerk/var-from-def deref)]
(is (= [0 0] (get-values blocks)))
(swap! !offset inc)
(let [get-values (fn [blocks] (into [] (map (comp :nextjournal/value :result blocks)) [2 4]))
!offset (-> blocks second :result :nextjournal/value :nextjournal.clerk/var-from-def deref)]
(testing "has correct values initially"
(is (= [0 0] (get-values blocks))))

(testing "has incremented values after swap!"
(is (swap! !offset inc))
(is (= [1 1] (get-values (:blocks (eval-string-in-session code-string :foo)))))))))

(clerk/defcached my-expansive-thing
Expand Down

0 comments on commit eb2a37e

Please sign in to comment.