Skip to content

Commit

Permalink
#201: add testcases for Subroutine import redefined at .../Config.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Nov 14, 2013
1 parent 4a9d2dc commit 0652c17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions t/issue201.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /usr/bin/env perl
# http://code.google.com/p/perl-compiler/issues/detail?id=201
# Subroutine import redefined at .../Config.pm line 38
BEGIN {
unless (-d '.git') {
print "1..0 #SKIP Only if -d .git\n";
exit;
}
}
use strict;
use Test::More tests => 2;

my $X = $^X =~ m/\s/ ? qq{"$^X"} : $^X;
my $perlcc = "$X -Iblib/arch -Iblib/lib blib/script/perlcc";

my $result = `$perlcc -r -e 'use Storable;*Storable::CAN_FLOCK=sub{1};print qq{ok\n}' 2>err`;
my $err = do { local $/; open my $fh, "err"; <$fh> };
is($err, "", "stderr");
is($result, "ok\n");
2 changes: 2 additions & 0 deletions t/testc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ tests[200]='%u=("\x{123}"=>"fo"); print "ok" if $u{"\x{123}"} eq "fo"'
result[200]='ok'
tests[2001]='BEGIN{%u=("\x{123}"=>"fo");} print "ok" if $u{"\x{123}"} eq "fo";'
result[2001]='ok'
tests[201]='use Storable;*Storable::CAN_FLOCK=sub{1};print qq{ok\n}'
result[201]='ok'
#issue 30
tests[230]='sub f1 { my($self) = @_; $self->f2;} sub f2 {} sub new {} print "@ARGV\n";'
result[230]=''
Expand Down

0 comments on commit 0652c17

Please sign in to comment.