File: 05_class.t

package info (click to toggle)
libfile-sharedir-perl 1.118-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 216 kB
  • sloc: perl: 949; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl

use strict;
use warnings;

use Cwd            ('abs_path');
use File::Basename ('dirname');
use File::Spec     ();
use Test::More;

#####################################################################
# Class Tests

{
    my @TEST_INC = @INC;
    local @INC = (File::Spec->catdir(abs_path(dirname($0)), "lib"), @TEST_INC);
    use_ok("ShareDir::TestClass");
}
my $class_file = File::ShareDir->can("class_file")->('ShareDir::TestClass', 'test_file.txt');
ok(-f $class_file, 'class_file ok');
my $module_file = File::ShareDir->can("module_file")->('File::ShareDir', 'test_file.txt');
is($class_file, $module_file, 'class_file matches module_file for subclass');

done_testing;