Caching being more of a performance optimization I'd be more concerned that the cached version was returning the correct answer than if it's using the cache. I mean you could do something wonky like using Time::HiRes to measure how long a cold call takes and compare that with how long a subsequent call for the same arguments takes, but I don't know that you really gain anything by doing so.
(And have you looked at what tests Memoize does? Even if you're not going to use it you might gain inspiration from it? (not that I've looked at its tests either, just mentioning the idea))
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: How to test caching?
by Fletch
in thread How to test caching?
by JavaFan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |