3 use Test::More qw(no_plan);
5 use File::Temp qw( tempdir tempfile );
7 my $perl = $^X || 'perl';
8 my $inc = join(' -I ', @INC) || '';
9 $inc = "-I $inc" if $inc;
12 my $dir = make_bad_file_1();
13 my ($fh, $outfile) = tempfile();
14 ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` );
17 like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 4/m, 'tabs found in tmp file 1' );
19 system("rm -rf $dir");
23 my $dir = make_bad_file_2();
24 my ($fh, $outfile) = tempfile();
25 ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` );
28 like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 12/m, 'tabs found in tmp file2 ' );
30 system("rm -rf $dir");
34 my ($dir, $file) = make_bad_file_3();
35 my ($fh, $outfile) = tempfile();
36 ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$file' )" 2>&1 > $outfile` );
39 like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 6/m, 'tabs found in tmp file 3' );
41 system("rm -rf $dir");
45 my $tmpdir = tempdir();
46 my ($fh, $filename) = tempfile( DIR => $tmpdir, SUFFIX => '.pL' );
58 my $tmpdir = tempdir();
59 my ($fh, $filename) = tempfile( DIR => $tmpdir, SUFFIX => '.pL' );
67 test.pL - A test script
79 my $tmpdir = tempdir();
80 my ($fh, $filename) = tempfile( DIR => $tmpdir, SUFFIX => '.pm' );
88 \tmy \$self = bless { }, \$class;
94 nick gerakines software engineer 22
96 return ($tmpdir, $filename);