merge of Snippet fix

This commit is contained in:
Colin Kuskie 2006-02-05 02:51:47 +00:00
parent 175622c23e
commit 67511cd89f
5 changed files with 49 additions and 3 deletions

View file

@ -15,7 +15,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 26; # increment this value for each test you create
use Test::More tests => 63; # increment this value for each test you create
my $session = WebGUI::Test->session;
@ -52,3 +52,41 @@ is($session->datetime->secondsToTime(60*60*8),"08:00:00", "secondsToTime()");
is($session->datetime->setToEpoch("2001-08-16 08:00:00"), $wgbday, "setToEpoch()");
ok($session->datetime->time() > $wgbday,"time()");
is($session->datetime->timeToSeconds("08:00:00"), 60*60*8, "timeToSeconds()");
my %conversion = (
"%c" => "%B",
"%C" => "%b",
"%d" => "%d",
"%D" => "%e",
"%h" => "%I",
"%H" => "%l",
"%j" => "%H",
"%J" => "%k",
"%m" => "%m",
"%M" => "%_varmonth_",
"%n" => "%M",
"%O" => "%z",
"%p" => "%P",
"%P" => "%p",
"%s" => "%S",
"%w" => "%A",
"%W" => "%a",
"%y" => "%Y",
"%Y" => "%y"
);
diag("check WebGUI to DateTime conversion");
foreach my $wg (keys %conversion) {
is( $session->datetime->wgToDt($wg), $conversion{$wg},
sprintf "WG to DT format conversion: %s => %s", $wg, $conversion{$wg});
}
%conversion = reverse %conversion;
delete $conversion{'%_varmonth_'};
diag("check DateTime to WebGUI conversion");
foreach my $dt (keys %conversion) {
is( $session->datetime->dtToWg($dt), $conversion{$dt},
sprintf "WG to DT format conversion: %s => %s", $dt, $conversion{$dt});
}

View file

@ -148,6 +148,12 @@ sub label_finder_pm {
sub obj_finder_pm {
next unless /\.pm$/;
warn "filename: $File::Find::name\n";
if ($File::Find::name =~ m#(?:Help|i18n)/?$#) {
warn "Pruned $File::Find::name\n";
$File::Find::prune=1;
return;
}
open my $pmf, $_
or die "unable to open file $File::Find::name: $!\n";
my $libFile = '';