Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test that fudging 'skip' does not hit lines with plain code
  • Loading branch information
usev6 committed Apr 17, 2015
1 parent bc9f52e commit 347b68e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
13 changes: 13 additions & 0 deletions t/05-skip.in
@@ -0,0 +1,13 @@
plan 4;

#?impl-1 2 skip 'NYI'
is 2+2, 4;
my $bar = 5;
is 2+3, $bar;

{
#?impl-1 2 skip 'NYI'
is 2*2, 4;
my $bar = 6;
is 2*3, $bar;
}
20 changes: 20 additions & 0 deletions t/05-skip.out_impl-1
@@ -0,0 +1,20 @@
plan 4;

#?impl-1 2 skip 'NYI'
skip('NYI', 1); # { is 2+2, 4;
# }
my $bar = 5;
skip('NYI', 1); # { is 2+3, $bar;
# }

{
#?impl-1 2 skip 'NYI'
skip('NYI', 1); # { is 2*2, 4;
# }
my $bar = 6;
skip('NYI', 1); # { is 2*3, $bar;
# }
}

say "# FUDGED!";
exit(1);
4 changes: 3 additions & 1 deletion t/fudge.t
Expand Up @@ -3,7 +3,7 @@
use strict;
use warnings;

use Test::More tests => 8;
use Test::More tests => 9;

sub is_fudged_ok($$$$);

Expand All @@ -21,6 +21,8 @@ is_fudged_ok '03-count', 'v6.0.0', 'v6.0.0', 'Simple test for fudging for imp
is_fudged_ok '04-combinations', 'impl.1', 'v6.0.0', 'combinations of fudging for implementation and version';
is_fudged_ok '04-combinations', 'impl.2', 'v6.0.6', 'combinations of fudging for implementation and version';

is_fudged_ok '05-skip', 'impl-1', 'v6.0.0', 'test for skip only works on actual tests';

sub is_fudged_ok($$$$) {
my ($file, $impl, $ver, $desc) = @_;
my ($in, $out) = ("t/$file.in", "t/$file.out_$impl");
Expand Down

0 comments on commit 347b68e

Please sign in to comment.