strap.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
BEGIN {
chdir 't';
}
else {
}
}
use strict;
### Testing _is_comment()
my $comment;
my %comments = (
"# stuff and things # and stuff" =>
' stuff and things # and stuff',
" # more things " => ' more things ',
"#" => '',
);
my $line_comment = $comments{$line};
}
### Testing _is_header()
'1..-1',
'2..2',
'',
);
" max, todo and skip_all are not set" );
}
my %headers = (
},
},
},
},
'todo' => { 2 => 1,
4 => 1,
10 => 1,
},
},
'1..192 todo 4 2 13 192 # Skip skip skip because' =>
{ max => 192,
'todo' => { 4 => 1,
2 => 1,
13 => 1,
192 => 1,
},
skip_all => 'skip skip because'
}
);
' the right attributes are there' );
}
### Testing _is_test()
my %tests = (
'ok' => { 'ok' => 1 },
'not ok' => { 'ok' => 0 },
'ok 1066 - and all that' => { 'ok' => 1,
number => 1066,
'not ok 42 - universal constant' =>
{ 'ok' => 0,
number => 42,
},
'not ok 23 # TODO world peace' => { 'ok' => 0,
number => 23,
type => 'todo',
reason => 'world peace'
},
'ok 11 - have life # TODO get a life' =>
{ 'ok' => 1,
number => 11,
type => 'todo',
reason => 'get a life'
},
'not ok # TODO' => { 'ok' => 0,
type => 'todo',
reason => ''
},
'ok # skip' => { 'ok' => 1,
type => 'skip',
},
'not ok 11 - this is \# all the name # skip this is not'
=> { 'ok' => 0,
number => 11,
type => 'skip',
reason => 'this is not'
},
"ok 42 - _is_header() is a header '1..192 todo 4 2 13 192 \\# Skip skip skip because"
=> { 'ok' => 1,
number => 42,
},
);
my %test;
}
}
my @untests = (
' ok',
'not',
'okay 23',
);
my %test = ();
# is( keys %test, 0 ) won't work in 5.004 because it's undef.
}
### Test _is_bail_out()
my %bails = (
'Bail out! Wing on fire.' => 'Wing on fire.',
'bail out! - Out of coffee' => '- Out of coffee',
);
my $reason;
}
my @unbails = (
' Bail out!',
'BAIL OUT',
'frobnitz',
'ok 23 - BAIL OUT!',
);
my $reason;
}