File: 100-internal--default_locations.t

package info (click to toggle)
libtest-compile-perl 3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: perl: 816; makefile: 2; sh: 1
file content (44 lines) | stat: -rw-r--r-- 779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!perl

use strict;
use warnings;

use Test::More;
use Test::Compile::Internal;
use File::Spec;

my $internal = Test::Compile::Internal->new();
my @locations;

# Given, When
@locations = $internal->_default_locations();

# Then
is(@locations, 0, "no locations found");

# Given, When
@locations = $internal->_default_locations("flubber");

# Then
is(@locations, 0, "didn't find flubber");

# Given, When
@locations = $internal->_default_locations("lib");

# Then
is(@locations, 1, "lib directory seems good");

# Given
if ( -e 'blib' ) {
    # When
    @locations = $internal->_default_locations("lib");

    # Then
    my $expected = File::Spec->catfile("blib", "lib");
    is($locations[0], $expected, "prefer to look in blib if it's available");
}



$internal->done_testing