diff options
| author | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:23:25 -0500 |
|---|---|---|
| committer | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:23:25 -0500 |
| commit | e76b691e78e273226cba9284cb8cd22a423319ed (patch) | |
| tree | a58d22f69869fe2bf3885f81bdda4952f87ff6d7 /bucky2/t/when.pl | |
| parent | 753f60c7d4769fa72d3b910e491f37db6f130898 (diff) | |
bucky2
Diffstat (limited to 'bucky2/t/when.pl')
| -rwxr-xr-x | bucky2/t/when.pl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bucky2/t/when.pl b/bucky2/t/when.pl new file mode 100755 index 0000000..4e13427 --- /dev/null +++ b/bucky2/t/when.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl +use lib "../lib"; +use Common; + +my $rules_x = [ qw[ 5 10 30 60 75 125 210 300 600 1250 3600 ] ]; +my $rules_y = [ 1, (60*60*24), (50), (50) ]; +my $tasks = [ time ]; +my $y_oper = 1; +for my $y (@$rules_y) + { + $y_oper *= $y; + for my $x (@$rules_x) + { +# print "$x\t$y_oper\t" . int($x * $y_oper) . " " . ( time - int( $x * $y_oper) ). "\n"; + push @$tasks, (time - int( $x * $y_oper )); + } + } +run_tasks($tasks); + +sub run_tasks + { + my ($tasks) = @_; + for my $task (@$tasks) + { + print $task . "\t-- "; + print test($task) . "\t"; +# print expected($task) . "\n"; + print control($task) . "\n"; + } + } +sub test + { my ($task) = @_; return Common->get_age($task); } +sub control + { my ($task) = @_; return Common->show_date($task); } +#sub _load_expected +# { my ($self, $task, $expected) = @_; $self->{'expected'} ||= {}; $self->{'expected'}->{$task} = $expected; } +1; |
