anchor.diff:  %% Test
   %%
   
  +setup_eunit_proc_dict() ->
  +    erlang:put({?MODULE, eunit}, true).
  +
  +file_write_options() ->
  +    case erlang:get({?MODULE, eunit}) of
  +        true ->
  +            [write, raw, binary];
  +        _ ->
  +            [write, raw, binary, delayed_write]
  +    end.
  +
   -ifdef(TEST).
   
  -%% direct_prune_test() ->
  -%%     S0 = slide:fresh(10),
  -%%     S1 = slide:update(S0, 5, 3),
  -%%     ?assertEqual(S1, prune(S1, 2)),
  -%%     ?assertEqual(S0, prune(S1, 4)).
  -
  -%% maybe_prune_test() ->
  -%%     S0 = slide:fresh(10, 20),
  -%%     S1 = slide:update(S0, 3, 1),
  -%%     S2 = slide:update(S1, 5, 15),
  -%%     ?assertEqual(S2, maybe_prune(S2, 12)),
  -%%     ?assertEqual({1,5}, slide:sum(maybe_prune(S2, 22), 22)).
  -
  -%% auto_prune_test() ->
  -%%     S0 = slide:fresh(10),
  -%%     S1 = slide:update(S0, 5, 3),
  -%%     S2 = slide:update(S1, 6, 14),
  -%%     ?assertEqual({1, 5}, slide:sum(S1, 4, 10)),
  -%%     ?assertEqual({1, 6}, slide:sum(S2, 15, 10)).
  +auto_prune_test() ->
  +    S0 = slide:fresh(10),
  +    S1 = slide:update(S0, 5, 3),
  +    S1b = idle_time_passing(S1, 4, 13),
  +    S2 = slide:update(S1b, 6, 14),
  +    S2b = idle_time_passing(S2, 15, 15),
  +    ?assertEqual(6, element(2, slide:sum(S2b, 15, 10))).
   
   sum_test() ->
  +    setup_eunit_proc_dict(),
       S0 = slide:fresh(10),
       ?assertEqual({0, 0}, % no points, sum = 0
                    slide:sum(S0, 9, 10)),
  
positive.code:                  catch file:close(FH),
                   File = integer_to_list(Moment rem S0#slide.window),
                   {ok, FH2} = file:open(filename:join(Dir, File),
                                         [write, raw, binary, delayed_write]),
                   S0#slide{readings_m = Moment,
                            readings_fh = FH2,
                            oldest = if Oldest == undefined ->
  
negative.code:     S3 = slide:update(S2, 7, 5),
      ?assertEqual({3, 5.0}, % three points (two concurrent), avg = 5
                    slide:mean(S3, 9, 10)),
      S3b = idle_time_passing(S3, 6, 13),
      S4 = slide:update(S3b, 11, 14),
      ?assertEqual(23/11, % ignoring first reading, avg = 
                   element(2, slide:mean(S4, 14, 10))),
      S4b = idle_time_passing(S4, 15, 18),
      ?assertEqual(11/10, % shifted window
                   element(2, slide:mean(S4b, 18, 10))),
      S4c = idle_time_passing(S4b, 19, 21),
      S5 = slide:update(S4c, 13, 22),
      ?assertEqual(24/10, % shifted window
                   element(2, slide:mean(S5, 22, 10))).
      
  mean_and_nines_test() ->
      setup_eunit_proc_dict(),
      PushReadings = fun(S, Readings) ->
                             lists:foldl(
                               fun({R,T}, A) ->
  