Skip to content

Commit

Permalink
Downgrade the TAP version too high case to a warning. Our 'backwards
Browse files Browse the repository at this point in the history
compatibility should always be preserved' mantra makes it an error to
fail in the face of futureTAP.
  • Loading branch information
AndyA committed Apr 11, 2010
1 parent 87a53e5 commit 4b859b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
7 changes: 3 additions & 4 deletions lib/TAP/Parser.pm
Expand Up @@ -1257,10 +1257,9 @@ sub _make_state_table {
$ver_num = $DEFAULT_TAP_VERSION;
}
if ( $ver_num > $MAX_TAP_VERSION ) {
$self->_add_error(
"TAP specified version $ver_num but "
. "we don't know about versions later "
. "than $MAX_TAP_VERSION" );
warn "TAP specified version $ver_num but ",
"we don't know about versions later ",
"than $MAX_TAP_VERSION\n";
$ver_num = $MAX_TAP_VERSION;
}
$self->version($ver_num);
Expand Down
22 changes: 1 addition & 21 deletions t/parse.t
Expand Up @@ -12,7 +12,7 @@ BEGIN {
}
}

use Test::More tests => 294;
use Test::More tests => 292;
use IO::c55Capture;

use File::Spec;
Expand Down Expand Up @@ -757,26 +757,6 @@ END_TAP
like pop @errors,
qr/Explicit TAP version must be at least 13. Got version 12/,
'... and trapped expected version error';

# now too high a version
$tap = <<'END_TAP';
TAP version 14
1..2
ok 1 - input file opened
ok 2 - Gandalf wins
END_TAP

$parser = TAP::Parser->new( { tap => $tap } );

_get_results($parser);

@errors = $parser->parse_errors;

is @errors, 1, 'test too high version number';

like pop @errors,
qr/TAP specified version 14 but we don't know about versions later than 13/,
'... and trapped expected version error';
}

{
Expand Down

0 comments on commit 4b859b0

Please sign in to comment.