anchor.diff:  %% @doc Caching module. Uses ETS to cache cache output.
   -module(cache).
   -export([cached_fun/2, create_table/0, delete_table/0]).
  +-include_lib("stdlib/include/ms_transform.hrl").
   
   %% @doc LIFETIME defines, in seconds, cache lifetime
   -ifdef(TEST).
  
positive.code: 
  cached_fun_miss_test() ->
      F = fun(K) -> K ++ "demo" end, %A mock function
      ?assertEqual(cached_fun(F, "127"), {"127demo", miss}).
  cached_fun_insert_test() ->
      F = fun(K) -> K ++ "demo" end, %A mock function
      ?assertEqual(cached_fun(F, "127"), {"127demo", hit}).
  
negative.code:     F = fun(K) -> K ++ "demo" end, %A mock function
      timer:sleep((?LIFETIME+1)*1000),
      ?assertEqual(cached_fun(F, "127"), {"127demo", expire}).
  cache_cleanup_test() ->
      F = fun(K) -> K ++ "demo" end, %A mock function
      ?assertEqual(cached_fun(F, "cleanme2"), {"cleanme2demo", miss}),
      %The above insetion of a new value, afer the LIFETIME sleep ealier,
      %should have cleaned up the earlier value below.
      ?assertEqual(cached_fun(F, "cleanme"), {"cleanmedemo", miss}).
  
  delete_table_test() ->
      delete_table().
  