Skip to content

Commit

Permalink
memoize test
Browse files Browse the repository at this point in the history
  • Loading branch information
darkleaf committed Nov 8, 2024
1 parent 201ed3c commit e76cb5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/darkleaf/di/cache_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e76cb5d

Please sign in to comment.