File: 04_special.t

package info (click to toggle)
libsys-filesystem-perl 1.408-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 272 kB
  • sloc: perl: 1,033; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,025 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
45
#!perl

use strict;
use warnings;

use Test::More;
use Sys::Filesystem;

my $fs;
eval { $fs = Sys::Filesystem->new(); };

$@ and plan skip_all => "Cannot initialize Sys::Filesystem: $@";

ok(ref($fs) eq 'Sys::Filesystem', 'Create new Sys::Filesystem object');

my @special_filesystems = $fs->special_filesystems();
my @regular_filesystems = $fs->regular_filesystems();

SKIP:
{

    skip('Badly poor supported OS or no file systems found.', 0) unless (@regular_filesystems);
    ok(@regular_filesystems, 'Get list of regular filesystems');

    for my $filesystem (@regular_filesystems)
    {
        my $special = $fs->special($filesystem) || 0;
        ok(!$special, "Regular");
    }
}

SKIP:
{

    skip('Badly poor supported OS or no file systems found.', 0) unless (@special_filesystems);
    ok(@special_filesystems, 'Get list of regular filesystems');

    for my $filesystem (@special_filesystems)
    {
        my $special = $fs->special($filesystem) || 0;
        ok($special, "Special");
    }
}

done_testing();