diag ("\n"); for my $delta ($delta_time, $delta_date){ for my $field (qw (seconds minutes hours days months years)) { for my $type ('','total_') { my $func = "${type}${field}"; for my $prec ('','trunc') { diag ("comapring ".$delta->$func($prec)." to ".$test_values[$test_index]." at ".$test_index." func=".$func." prec=".$prec." type=".$type." field=".$field); ok($delta->$func($prec) == $test_values[$test_index++],"$func($prec) ($delta_text[$delta_index])") #or diag("Expected " . $test_values[$test_index++] . " got " . $delta->$func($prec)); or diag("Expected " . $test_values[$test_index] . " got " . $delta->$func($prec)); } } } $delta_index++; }