File: unit-files-are-the-same.t

package info (click to toggle)
perlbrew 1.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 752 kB
  • sloc: perl: 9,387; makefile: 7; sh: 1
file content (20 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl
use Test2::V0;
use App::Perlbrew::Util qw(files_are_the_same);

use FindBin qw($RealBin);

my @test_files = (<$RealBin/*.t>)[0..9];

for my $i (0..$#test_files) {
    my $t = $test_files[$i];
    my $u = $test_files[$i - 1];
    my $should_be_same = files_are_the_same($t, $t);
    my $should_not_be_same = files_are_the_same($t, $u);

    note "Comparing $t with $u";
    ok ($^O eq 'MSWin32' xor $should_be_same); # should return false on win32
    ok !$should_not_be_same;
}

done_testing;