Skip to content
Browse files

Remove all tabs

  • Loading branch information...
1 parent 6241376 commit a554d113e88c4450f4f6f0d3b3696ab7f52dce62 @autarch committed Apr 2, 2013
Showing with 102 additions and 102 deletions.
  1. +13 −13 examples/Simple.pm
  2. +21 −21 t/dispatch.t
  3. +14 −14 t/import.t
  4. +20 −20 t/nocon.t
  5. +5 −5 t/noredef.t
  6. +29 −29 t/verbose.t
View
26 examples/Simple.pm
@@ -6,24 +6,24 @@ use DateTime::Format::Builder (
{
params => [qw( year month mday hours mins secs fsecs ampm )],
regex => qr[^
- (\d{4}) \s*-?\s* (\d{2}) \s*-?\s* (\d{2})
- \s*
- (?:-?\s* (\d{1,2}) :? (\d{2}) (?::? (\d{2}) )? )?
- (?:\. (\d+) ) ? # fsecs
- (?:\s* ([aApP]\.?[mM]\.?) )?
- $
- ]x,
+ (\d{4}) \s*-?\s* (\d{2}) \s*-?\s* (\d{2})
+ \s*
+ (?:-?\s* (\d{1,2}) :? (\d{2}) (?::? (\d{2}) )? )?
+ (?:\. (\d+) ) ? # fsecs
+ (?:\s* ([aApP]\.?[mM]\.?) )?
+ $
+ ]x,
},
{
# mm/dd/yyyy, mm-dd-yyyy, [hh:mm[:ss[.nnn]]] [am/pm]
params => [qw( month mday year hours mins secs fsecs ampm )],
regex => qr#^
- (\d{1,2})[-/](\d{1,2})[-/](\d{4})
- (?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?
- (?:\.(\d+))?
- (?:\s*([aApP]\.?[mM]\.?))?
- $
- #x
+ (\d{1,2})[-/](\d{1,2})[-/](\d{4})
+ (?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?
+ (?:\.(\d+))?
+ (?:\s*([aApP]\.?[mM]\.?))?
+ $
+ #x
},
]
}
View
42 t/dispatch.t
@@ -7,27 +7,27 @@ use DateTime::Format::Builder;
{
eval q[
- package SampleDispatch;
- use DateTime::Format::Builder
- (
- parsers => {
- parse_datetime => [
- {
- Dispatch => sub {
- return 'fnerk';
- }
- }
- ]
- },
- groups => {
- fnerk => [
- {
- regex => qr/^(\d{4})(\d\d)(\d\d)$/,
- params => [qw( year month day )],
- },
- ]
- }
- );
+ package SampleDispatch;
+ use DateTime::Format::Builder
+ (
+ parsers => {
+ parse_datetime => [
+ {
+ Dispatch => sub {
+ return 'fnerk';
+ }
+ }
+ ]
+ },
+ groups => {
+ fnerk => [
+ {
+ regex => qr/^(\d{4})(\d\d)(\d\d)$/,
+ params => [qw( year month day )],
+ },
+ ]
+ }
+ );
];
ok( !$@, "No errors when creating the class." );
if ($@) { diag $@; exit }
View
28 t/import.t
@@ -5,20 +5,20 @@ use Test::More;
{
eval q[
- package SampleClass1;
- use DateTime::Format::Builder
- parsers => {
- parse_datetime => [
- {
- regex => qr/^(\d{4})(\d\d)(d\d)(\d\d)(\d\d)(\d\d)$/,
- params => [qw( year month day hour minute second )],
- },
- {
- regex => qr/^(\d{4})(\d\d)(\d\d)$/,
- params => [qw( year month day )],
- },
- ],
- };
+ package SampleClass1;
+ use DateTime::Format::Builder
+ parsers => {
+ parse_datetime => [
+ {
+ regex => qr/^(\d{4})(\d\d)(d\d)(\d\d)(\d\d)(\d\d)$/,
+ params => [qw( year month day hour minute second )],
+ },
+ {
+ regex => qr/^(\d{4})(\d\d)(\d\d)$/,
+ params => [qw( year month day )],
+ },
+ ],
+ };
];
ok( !$@, "No errors when creating the class." );
View
40 t/nocon.t
@@ -21,11 +21,11 @@ my %parsers = (
{
my $class = 'SampleClass1';
eval q[
- package SampleClass1;
- use DateTime::Format::Builder
- constructor => undef,
- %parsers;
- 1;
+ package SampleClass1;
+ use DateTime::Format::Builder
+ constructor => undef,
+ %parsers;
+ 1;
];
ok( !$@, "No errors when creating the class." );
@@ -49,11 +49,11 @@ my %parsers = (
my $class = 'SampleClassHasNew';
sub SampleClassHasNew::new { return "4" }
eval q[
- package SampleClassHasNew;
- use DateTime::Format::Builder
- constructor => 1,
- %parsers;
- 1;
+ package SampleClassHasNew;
+ use DateTime::Format::Builder
+ constructor => 1,
+ %parsers;
+ 1;
];
ok( $@, "Error when creating class." );
}
@@ -63,11 +63,11 @@ my %parsers = (
my $class = 'SampleClassDont';
sub SampleClassDont::new { return "5" }
eval q[
- package SampleClassDont;
- use DateTime::Format::Builder
- constructor => 0,
- %parsers;
- 1;
+ package SampleClassDont;
+ use DateTime::Format::Builder
+ constructor => 0,
+ %parsers;
+ 1;
];
ok( !$@, "No error when creating class." );
diag $@ if $@;
@@ -80,11 +80,11 @@ my %parsers = (
{
my $class = 'SampleClassGiven';
eval q[
- package SampleClassGiven;
- use DateTime::Format::Builder
- constructor => sub { return "6" },
- %parsers;
- 1;
+ package SampleClassGiven;
+ use DateTime::Format::Builder
+ constructor => sub { return "6" },
+ %parsers;
+ 1;
];
ok( !$@, "No error when creating class." );
diag $@ if $@;
View
10 t/noredef.t
@@ -22,11 +22,11 @@ my %parsers = (
my $class = 'SampleClassHasParser';
sub SampleClassHasParser::parse_datetime { return "4" }
eval q[
- package SampleClassHasParser;
- use DateTime::Format::Builder
- constructor => 1,
- %parsers;
- 1;
+ package SampleClassHasParser;
+ use DateTime::Format::Builder
+ constructor => 1,
+ %parsers;
+ 1;
];
ok( $@, "Error when creating class." );
}
View
58 t/verbose.t
@@ -13,38 +13,38 @@ SKIP: {
my $str;
undef $SampleClass1::fh; # just to un-warn
eval q{
- open $SampleClass1::fh, '>', \$str
- or die "Cannot open string for writing!";
+ open $SampleClass1::fh, '>', \$str
+ or die "Cannot open string for writing!";
};
eval q[
- package SampleClass1;
- use DateTime::Format::Builder
- verbose => $SampleClass1::fh,
- parsers => {
- parse_datetime => [
- [
- preprocess => sub { my %args = @_; $args{input} },
- ],
- {
- regex => qr/^(\d{4})(\d\d)(d\d)(\d\d)(\d\d)(\d\d)$/,
- params => [qw( year month day hour minute second )],
- on_fail => sub { my %args = @_; $args{input} },
- },
- {
- preprocess => sub { my %args = @_; $args{input} },
- postprocess => sub { my %args = @_; $args{input} },
- on_match => sub { my %args = @_; $args{input} },
- regex => qr/^(\d{4})(\d\d)(\d\d)$/,
- params => [qw( year month day )],
- },
- {
- length => 8,
- regex => qr/^abcdef$/,
- params => [qw( year month day )],
- }
- ],
- };
+ package SampleClass1;
+ use DateTime::Format::Builder
+ verbose => $SampleClass1::fh,
+ parsers => {
+ parse_datetime => [
+ [
+ preprocess => sub { my %args = @_; $args{input} },
+ ],
+ {
+ regex => qr/^(\d{4})(\d\d)(d\d)(\d\d)(\d\d)(\d\d)$/,
+ params => [qw( year month day hour minute second )],
+ on_fail => sub { my %args = @_; $args{input} },
+ },
+ {
+ preprocess => sub { my %args = @_; $args{input} },
+ postprocess => sub { my %args = @_; $args{input} },
+ on_match => sub { my %args = @_; $args{input} },
+ regex => qr/^(\d{4})(\d\d)(\d\d)$/,
+ params => [qw( year month day )],
+ },
+ {
+ length => 8,
+ regex => qr/^abcdef$/,
+ params => [qw( year month day )],
+ }
+ ],
+ };
];
ok( !$@, "No errors when creating the class." );

0 comments on commit a554d11

Please sign in to comment.
Something went wrong with that request. Please try again.