Cache:...Tester(3pm)

πŸ’– Cache::CacheTester β€” the vibe check for your caches πŸ’–

okay so real talk, this is Cache:...Tester(3pm) from the User Contributed Perl Documentation, and it is exactly what it sounds like: a whole little class whose entire job is regression testing caches. she's the friend who shows up to your cache implementation and goes "prove it." πŸ‘‘


✨ NAME ✨

Cache::CacheTester β€” bestie, it's a class for regression testing caches. that's the whole thing. that's her.


🌸 DESCRIPTION 🌸

The CacheTester is used to verify that a cache implementation honors its contract. like, your cache said it would do the things. CacheTester is gonna hold it to that. no cap, no exceptions, no "oops I forgot to expire that key." it's giving accountability. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

use Cache::MemoryCache;
use Cache::CacheTester;

my $cache = new Cache::MemoryCache( );

my $cache_tester = new Cache::CacheTester( 1 );

$cache_tester->test( $cache );

so you make a cache, you make a tester, you make the tester test the cache. iconic little pipeline honestly. ✨


πŸŽ€ METHODS πŸŽ€

  • new( $initial_count ) β€” Construct a new CacheTester object, with the counter starting at $initial_count. yes the counter is a thing you hand over right at birth, she does not come pre-counted. you decide where she starts. πŸ’–
  • test( ) β€” Run the tests. that's it. that's the sentence. go run the tests, bestie. πŸƒβ™€οΈπŸ’¨

πŸ‘€ SEE ALSO πŸ‘€

  • Cache::Cache
  • Cache::BaseCacheTester

go read these too, they're the extended universe, iykyk. 🌈


🫢 AUTHOR 🫢

Original author: DeWitt Clinton <dewitt@unto.net>

Last author: $Author: dclinton $

Copyright (C) 2001-2003 DeWitt Clinton

the literal OG. putting respect on the name. πŸ‘‘


πŸ’€ quick reminder: the counter starts wherever you tell it to with $initial_count, and test( ) is the one doing the actual testing. don't skip her. she's the main character of this whole page.

and that's the whole page, bestie!! πŸ’œ this is Cache:...Tester(3pm), from perl v5.34.0, dated 2022-06-30, and yes she is still out here making caches behave. slay. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from