Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
darkleaf committed Oct 14, 2024
1 parent af47d9b commit ec393ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/darkleaf/di/tutorial/z_memoize_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,24 @@
(with-open [local (di/start `root
(di/use-cache cache))]
(t/is (identical? global-system @local)))))

#_
;; or should we use external atom to also cache in local system?
(t/deftest ok
(let [cache (atom {}) ;; (di/make-cache)
global-system (di/start `root
(di/collect-cache cache))]

(with-open [local (di/start `root
(di/use-cache cache)
(di/collect-cache cache))]
(t/is (identical? @global-system @local)))))
#_
(t/deftest ok
(let [cache (atom {}) ;; (di/make-cache)
global-system (di/start `root
(di/use-cache cache))]

(with-open [local (di/start `root
(di/use-cache cache))]
(t/is (identical? @global-system @local)))))

0 comments on commit ec393ca

Please sign in to comment.