File: 03-subtype.t

package info (click to toggle)
libmoosex-types-path-class-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 292 kB
  • ctags: 1
  • sloc: perl: 236; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 571 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
use warnings;
use strict;

use MooseX::Types::Path::Class qw(Dir File);
use Moose::Util::TypeConstraints 'find_type_constraint';

use Test::More;

plan tests => 4;

# check that Dir is a subtype of Path::Class::Dir, etc...

my $tc;
$tc = find_type_constraint(Dir);
isa_ok( $tc, 'Moose::Meta::TypeConstraint' );
ok( $tc->is_subtype_of('Path::Class::Dir'),
    'Dir is subtype of Path::Class::Dir'
);
$tc = find_type_constraint(File);
isa_ok( $tc, 'Moose::Meta::TypeConstraint' );
ok( $tc->is_subtype_of('Path::Class::File'),
    'File is subtype of Path::Class::File'
);