File: DZil.t

package info (click to toggle)
libpath-isdev-perl 1.001003-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 728 kB
  • sloc: perl: 958; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 636 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
21
22
23
24
25
26
27
28
29
30
31
use strict;
use warnings;

use Test::More tests => 4;
use Path::Tiny qw(path);
use Test::Fatal qw( exception );
use FindBin;

sub nofatal {
  my ( $message, $sub ) = @_;
  my $e = exception { $sub->() };
  return is( $e, undef, $message );
}

my $corpus_dir = path($FindBin::Bin)->parent->parent->parent->child('corpus')->child('DZil');

nofatal 'Can require without exception' => sub {
  require Path::IsDev;
};

nofatal 'Can import without exception' => sub {
  Path::IsDev->import(qw(is_dev));
};

my $path;

nofatal 'Can call without exception' => sub {
  $path = is_dev($corpus_dir);
};

isnt( $path, undef, 'path is a dev dir' );