diff --git a/test/darkleaf/di/tutorial/z_memoize_test.clj b/test/darkleaf/di/tutorial/z_memoize_test.clj index eee64886..e71dd9f7 100644 --- a/test/darkleaf/di/tutorial/z_memoize_test.clj +++ b/test/darkleaf/di/tutorial/z_memoize_test.clj @@ -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)))))