Make the Date macro handle leading and trailing whitespace. Fixes bug #11542.
This commit is contained in:
parent
42a6b612f7
commit
b9c2a3b0ad
3 changed files with 15 additions and 6 deletions
|
|
@ -8,7 +8,6 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
|
@ -17,9 +16,9 @@ use WebGUI::Test;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Macro::D_date;
|
||||
use Data::Dumper;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
use Test::More;
|
||||
use Test::Exception;
|
||||
|
||||
my $wgbday = WebGUI::Test->webguiBirthday;
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ my @testSets = (
|
|||
},
|
||||
);
|
||||
|
||||
my $numTests = scalar @testSets + 2;
|
||||
my $numTests = scalar @testSets + 4;
|
||||
|
||||
plan tests => $numTests;
|
||||
|
||||
|
|
@ -62,5 +61,10 @@ is($output, $session->datetime->epochToHuman($time1), 'checking default time and
|
|||
|
||||
##Checking for edge case, time=0
|
||||
is WebGUI::Macro::D_date::process($session, '', 0),
|
||||
'12/31/1969 6:00 pm',
|
||||
'...checking for handling time=0';
|
||||
'12/31/1969 6:00 pm',
|
||||
'...checking for handling time=0';
|
||||
|
||||
lives_ok { WebGUI::Macro::D_date::process($session, '', ' 0') }
|
||||
'handles leading whitespace okay';
|
||||
lives_ok { WebGUI::Macro::D_date::process($session, '', '0 ') }
|
||||
'handles trailing whitespace okay';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue