Update of /cvsroot/file-extattr/File-ExtAttr/t
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv9280/t
Modified Files:
30nsbasic.t
Log Message:
First cut of namespace list function for Linux
Index: 30nsbasic.t
===================================================================
RCS file: /cvsroot/file-extattr/File-ExtAttr/t/30nsbasic.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** 30nsbasic.t 19 Aug 2006 14:06:25 -0000 1.1
--- 30nsbasic.t 1 Oct 2006 11:18:54 -0000 1.2
***************
*** 1,3 ****
! #!perl -T
# Before `make install' is performed this script should be runnable with
--- 1,3 ----
! #!perl -T -w
# Before `make install' is performed this script should be runnable with
***************
*** 9,15 ****
use strict;
! use Test::More tests => 8;
use File::Temp qw(tempfile);
! use File::ExtAttr qw(setfattr getfattr delfattr);
use IO::File;
--- 9,15 ----
use strict;
! use Test::More tests => 12;
use File::Temp qw(tempfile);
! use File::ExtAttr qw(setfattr getfattr delfattr listfattrns);
use IO::File;
***************
*** 24,27 ****
--- 24,29 ----
my $val = "ZZZadlf03948alsdjfaslfjaoweir12l34kealfkjalskdfas90d8fajdlfkj./.,f";
+ my @ns;
+
##########################
# Filename-based tests #
***************
*** 39,42 ****
--- 41,48 ----
is (setfattr($filename, "$key", $val, { namespace => 'user' }), 1);
+ #check user namespace exists now
+ @ns = listfattrns($filename);
+ is (grep(/^user$/, @ns), 1);
+
#read it back
is (getfattr($filename, "$key", { namespace => 'user' }), $val);
***************
*** 47,50 ****
--- 53,60 ----
#check that it's gone
is (getfattr($filename, "$key", { namespace => 'user' }), undef);
+
+ #check user namespace doesn't exist now
+ @ns = listfattrns($filename);
+ is (grep(/^user$/, @ns), 0);
#}
#print STDERR "done\n";
***************
*** 68,71 ****
--- 78,85 ----
is (setfattr($fh, "$key", $val, { namespace => 'user' }), 1);
+ #check user namespace exists now
+ @ns = listfattrns($fh);
+ is (grep(/^user$/, @ns), 1);
+
#read it back
is (getfattr($fh, "$key", { namespace => 'user' }), $val);
***************
*** 76,79 ****
--- 90,97 ----
#check that it's gone
is (getfattr($fh, "$key", { namespace => 'user' }), undef);
+
+ #check user namespace doesn't exist now
+ @ns = listfattrns($fh);
+ is (grep(/^user$/, @ns), 0);
#}
#print STDERR "done\n";
|