From e76cb5dd7749b3d853378478182fdd7f48edfc58 Mon Sep 17 00:00:00 2001 From: Mikhail Kuzmin Date: Fri, 8 Nov 2024 16:26:41 +0400 Subject: [PATCH] memoize test --- test/darkleaf/di/cache_test.clj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/darkleaf/di/cache_test.clj b/test/darkleaf/di/cache_test.clj index 9236b3d..d33b795 100644 --- a/test/darkleaf/di/cache_test.clj +++ b/test/darkleaf/di/cache_test.clj @@ -5,6 +5,13 @@ (set! *warn-on-reflection* true) +(t/deftest memoize-test + (let [a 'a + identity* (memoize identity)] + (identity* a) + (t/is (not (identical? a (identity 'a)))) + (t/is (identical? a (identity* 'a))))) + (defn- some+identical? [a b] (and (some? a) (some? b)