1#!perl -w
2
3# Before `make install' is performed this script should be runnable with
4# `make test'. After `make install' it should work as `perl Linux-xattr.t'
5
6##########################
7
8# change 'tests => 2' to 'tests => last_test_to_print';
9
10use strict;
11use Test::More;
12use Data::Dumper;
13
14BEGIN {
15  my $tlib = $0;
16  $tlib =~ s|/[^/]*$|/lib|;
17  push(@INC, $tlib);
18}
19use t::Support;
20
21if (t::Support::should_skip()) {
22  plan skip_all => 'Tests unsupported on this OS/filesystem';
23} else {
24  plan tests => 1;
25}
26
27use File::Temp qw(tempfile);
28use File::Path;
29use File::ExtAttr qw(setfattr getfattr delfattr listfattrns);
30use IO::File;
31
32my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.');
33my ($fh, $filename) = tempfile( DIR => $TESTDIR );
34
35close $fh or die "can't close $filename $!";
36
37# This shouldn't crash.
38my @ns = listfattrns($fh);
39ok 1;
40
41END {
42    unlink $filename if $filename;
43};
44