5 use File::Rsync::Mirror::Recentfile;
6 use File::Rsync::Mirror::Recentfile::FakeBigFloat qw(_increase_a_bit _bigfloatlt);
10 my $rf = File::Rsync::Mirror::Recentfile->new;
11 for my $x ([-12, undef],
17 my $ret = eval { $rf->interval_secs(defined $x->[0] ? $x->[0] . "s" : ()); };
24 my $rf = File::Rsync::Mirror::Recentfile->new;
25 for my $x (["12s" => 12],
31 my $ret = $rf->interval_secs ( $x->[0] );
42 ["0.99999999900000080543804870103485882282257080078125",
43 "0.9999999990000010274826536260661669075489044189453125"],
45 # the following is an interesting example because I saw this in the debugger:
46 # DB<104> x "123456789123456789.2" <=> "123456789123456790"
49 ["123456789123456789","123456789123456790"],
52 if (defined $_->[1]) {
60 my $ret = _increase_a_bit ( $x->[0], $x->[1] );
61 ok _bigfloatlt($x->[0], $ret), "L: $x->[0] < $ret";
62 if (defined $x->[1]) {
63 ok _bigfloatlt($ret, $x->[1]), "R: $ret < $x->[1]";
71 @x = split /\n/, <<EOT;
72 ge 1195248431 997872011
73 ge 1195248431.1 997872011
74 ge 1195248431 997872011.1
75 ge 1195248431.1 997872011.1
76 gt 1195248431 997872011
77 gt 1195248431.1 997872011
78 gt 1195248431 997872011.1
79 gt 1195248431.1 997872011.1
80 ge 1234567891195248431 123456789997872011
81 ge 1234567891195248431.1 123456789997872011
82 ge 1234567891195248431 123456789997872011.1
83 ge 1234567891195248431.1 123456789997872011.1
84 gt 1234567891195248431 123456789997872011
85 gt 1234567891195248431.1 123456789997872011
86 gt 1234567891195248431 123456789997872011.1
87 gt 1234567891195248431.1 123456789997872011.1
92 my($func,@arg) = split " ", $line;
93 $func = \&{"File::Rsync::Mirror::Recentfile::FakeBigFloat::_bigfloat$func"};
94 ok $func->(@arg), "$line";
98 BEGIN { plan tests => $tests }
102 # cperl-indent-level: 4