anchor.diff:    SecondsSplitFun = fun(S) -> S end,
     SecondsATF =
       #time_formatter{
  -       threshold  = 1 * 60,
  +       threshold  = 60 * 1,
          rounding   = 1,
          split_fun  = SecondsSplitFun,
          one_format = "~ws"
  
positive.code:       },
    [ SecondsATF
    , MinutesATF
    , QuartersATF
    , HoursATF
    , DayQuartersATF
    , DaysATF
    , MonthsATF
    , YearsATF
  
negative.code:   ?assertEqual("47h59m", time_string(47*60*60 + 59*60)),
    ?assertEqual("47h59m", time_string(47*60*60 + 59*60 + 59)),
  
    ?assertEqual("2d00h", time_string(2*24*60*60)),
    ?assertEqual("2d00h", time_string(2*24*60*60 + 59*60)),
    ?assertEqual("2d01h", time_string(2*24*60*60 + 60*60)),
  
    ?assertEqual("17d03h", time_string(17*24*60*60 + 3*60*60)),
    ok.
  
  approximate_time_format_test() ->
  
    ?assertEqual("<1m", approximate_time_string(0)),
    ?assertEqual("<1m", approximate_time_string(1)),
    ?assertEqual("<1m", approximate_time_string(42)),
    ?assertEqual("<1m", approximate_time_string(59)),
  
    ?assertEqual("1m", approximate_time_string(1*60)),
    ?assertEqual("1m", approximate_time_string(1*60 + 5)),
    ?assertEqual("1m", approximate_time_string(1*60 + 59)),
    ?assertEqual("4m", approximate_time_string(4*60 + 29)),
    ?assertEqual("9m", approximate_time_string(9*60 + 59)),
    ?assertEqual("10m", approximate_time_string(10*60 + 0)),
    ?assertEqual("17m", approximate_time_string(17*60 + 1)),
    ?assertEqual("29m", approximate_time_string(29*60 + 1)),
  
    ?assertEqual("30m", approximate_time_string(30*60 + 1)),
    ?assertEqual("30m", approximate_time_string(36*60 + 1)),
    ?assertEqual("40m", approximate_time_string(42*60 + 42)),
    ?assertEqual("50m", approximate_time_string(59*60 + 59)),
  
    ?assertEqual("1h00m", approximate_time_string(60*60)),
    ?assertEqual("1h00m", approximate_time_string(60*60 + 29)),
    ?assertEqual("1h00m", approximate_time_string(60*60 + 30)),
    ?assertEqual("1h00m", approximate_time_string(60*60 + 60)),
    ?assertEqual("1h10m", approximate_time_string(60*60 + 10*60)),
    ?assertEqual("1h40m", approximate_time_string(60*60 + 42*60)),
    ?assertEqual("2h", approximate_time_string(2*60*60 + 60)),
  
    ?assertEqual("9h", approximate_time_string(9*60*60 + 59*60 + 59)),
    ?assertEqual("10h", approximate_time_string(9*60*60 + 59*60 + 59 + 1)),
    ?assertEqual("23h", approximate_time_string(23*60*60 + 59*60 + 59)),
    ?assertEqual("24h", approximate_time_string(24*60*60)),
    ?assertEqual("24h", approximate_time_string(24*60*60 + 59)),
    ?assertEqual("47h", approximate_time_string(47*60*60 + 59*60)),
    ?assertEqual("47h", approximate_time_string(47*60*60 + 59*60 + 59)),
  
    ?assertEqual("2d", approximate_time_string(48*60*60)),
    ?assertEqual("2d", approximate_time_string(48*60*60 + 59*60)),
    ?assertEqual("2d", approximate_time_string(48*60*60 + 60*60)),
  
    ?assertEqual("6d", approximate_time_string(6*24*60*60)),
    ?assertEqual("7d", approximate_time_string(7*24*60*60)),
    ?assertEqual("8d", approximate_time_string(8*24*60*60)),
    ?assertEqual("58d", approximate_time_string(58*24*60*60)),
    ?assertEqual("320d", approximate_time_string(320*24*60*60)),
  
    ?assertEqual("1y03m", approximate_time_string((12+3)*30*24*60*60)),
    ?assertEqual("7y03m", approximate_time_string((7*12+3)*30*24*60*60)),
    ?assertEqual("40y06m", approximate_time_string((40*12+6)*30*24*60*60)),
  
    ?assertEqual("70y", approximate_time_string((70*12+6)*30*24*60*60)),
    ?assertEqual("90y", approximate_time_string((90*12+6)*30*24*60*60)),
    ?assertEqual("100y", approximate_time_string((100*12+6)*30*24*60*60)),
  
    ?assertEqual("> 10000y", approximate_time_string((10001*12+6)*30*24*60*60)),
    ok.
  
  -endif.
  