File: skip_git.t

package info (click to toggle)
libtest-fixme-perl 0.14-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 6
  • sloc: perl: 127; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Test::More tests => 2;
use File::Temp qw( tempdir );
use Test::Fixme;

my $dir = tempdir( CLEANUP => 1 );

foreach my $subdir (qw( .git .svn CVS ))
{
  mkdir(File::Spec->catdir($dir, $subdir));
  open(my $fh, '>', File::Spec->catfile($dir, $subdir, 'bad.txt'));
  close $fh;
}
mkdir(File::Spec->catdir($dir, 'foo.svn.gitSVNbar'));
open(my $fh, '>', File::Spec->catfile($dir, 'foo.svn.gitSVNbar', 'good.txt'));
close $fh;

my @list = Test::Fixme::list_files($dir);

is(scalar @list, 1, 'list length = 1') || diag join "\n", @list;
like $list[0], qr{good.txt$}, 'filename =~ good.txt';