r66491 - in /branches/upstream/libpath-class-perl/current: Changes MANIFEST META.yml Makefile.PL SIGNATURE dist.ini lib/Path/Class.pm lib/Path/Class/Dir.pm lib/Path/Class/Entity.pm lib/Path/Class/File.pm t/01-basic.t t/file-spec-tests

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Mon Dec 27 09:41:49 UTC 2010


Author: carnil
Date: Mon Dec 27 09:41:39 2010
New Revision: 66491

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66491
Log:
[svn-upgrade] new version libpath-class-perl (0.23)

Added:
    branches/upstream/libpath-class-perl/current/dist.ini
    branches/upstream/libpath-class-perl/current/t/file-spec-tests
Modified:
    branches/upstream/libpath-class-perl/current/Changes
    branches/upstream/libpath-class-perl/current/MANIFEST
    branches/upstream/libpath-class-perl/current/META.yml
    branches/upstream/libpath-class-perl/current/Makefile.PL
    branches/upstream/libpath-class-perl/current/SIGNATURE
    branches/upstream/libpath-class-perl/current/lib/Path/Class.pm
    branches/upstream/libpath-class-perl/current/lib/Path/Class/Dir.pm
    branches/upstream/libpath-class-perl/current/lib/Path/Class/Entity.pm
    branches/upstream/libpath-class-perl/current/lib/Path/Class/File.pm
    branches/upstream/libpath-class-perl/current/t/01-basic.t

Modified: branches/upstream/libpath-class-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/Changes?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/Changes (original)
+++ branches/upstream/libpath-class-perl/current/Changes Mon Dec 27 09:41:39 2010
@@ -1,4 +1,15 @@
 Revision history for Perl extension Path::Class.
+
+0.23 - Sun Dec 26 13:35:53 CST 2010
+
+ - Fixed a bunch of problems with the distribution (e.g. in META.yml)
+   that I introduced in the switch to Dist::Zilla.  No code changes
+   from 0.22.
+
+0.22 - Sat Dec 25 22:59:20 CST 2010
+
+ - Added a basename() method for directory objects. [CLKAO, jloverso,
+   THEPLER, ZUMMO]
 
 0.21 - Tue Aug 17 19:13:13 CDT 2010
 

Modified: branches/upstream/libpath-class-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/MANIFEST?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/MANIFEST (original)
+++ branches/upstream/libpath-class-perl/current/MANIFEST Mon Dec 27 09:41:39 2010
@@ -1,16 +1,18 @@
 Build.PL
 Changes
 INSTALL
+MANIFEST
+META.yml
+Makefile.PL
+README
+SIGNATURE
+dist.ini
 lib/Path/Class.pm
 lib/Path/Class/Dir.pm
 lib/Path/Class/Entity.pm
 lib/Path/Class/File.pm
-Makefile.PL
-MANIFEST
-META.yml
-README
 t/01-basic.t
 t/02-foreign.t
 t/03-filesystem.t
 t/04-subclass.t
-SIGNATURE    Added here by Module::Build
+t/file-spec-tests

Modified: branches/upstream/libpath-class-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/META.yml?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/META.yml (original)
+++ branches/upstream/libpath-class-perl/current/META.yml Mon Dec 27 09:41:39 2010
@@ -1,18 +1,19 @@
 ---
-name: Path-Class
-version: 0.21
+abstract: 'Cross-platform path specification manipulation'
 author:
-  - 'Ken Williams, KWILLIAMS at cpan.org'
-abstract: Cross-platform path specification manipulation
-license: perl
-resources:
-  bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Path-Class
-  homepage: http://code.google.com/p/perl-path-class
-  license: http://dev.perl.org/licenses/
-  repository: http://perl-path-class.googlecode.com/svn/trunk
+  - 'Ken Williams <kwilliams at cpan.org>'
 build_requires:
   File::Temp: 0
   Test::More: 0
+configure_requires:
+  ExtUtils::MakeMaker: 6.31
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Path-Class
 requires:
   Cwd: 0
   File::Path: 0
@@ -22,22 +23,7 @@
   IO::Dir: 0
   IO::File: 0
   overload: 0
-configure_requires:
-  Module::Build: 0.34
-provides:
-  Path::Class:
-    file: lib/Path/Class.pm
-    version: 0.21
-  Path::Class::Dir:
-    file: lib/Path/Class/Dir.pm
-    version: 0.21
-  Path::Class::Entity:
-    file: lib/Path/Class/Entity.pm
-    version: 0.21
-  Path::Class::File:
-    file: lib/Path/Class/File.pm
-    version: 0.21
-generated_by: Module::Build version 0.34
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+resources:
+  bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Path-Class
+  repository: http://perl-path-class.googlecode.com/svn/trunk
+version: 0.23

Modified: branches/upstream/libpath-class-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/Makefile.PL?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/Makefile.PL (original)
+++ branches/upstream/libpath-class-perl/current/Makefile.PL Mon Dec 27 09:41:39 2010
@@ -1,23 +1,61 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.34
-use ExtUtils::MakeMaker;
-WriteMakefile
-(
-          'NAME' => 'Path::Class',
-          'VERSION_FROM' => 'lib/Path/Class.pm',
-          'PREREQ_PM' => {
-                           'Cwd' => '0',
-                           'File::Path' => '0',
-                           'File::Spec' => '0.87',
-                           'File::Spec::Mac' => '1.3',
-                           'File::Temp' => '0',
-                           'File::stat' => '0',
-                           'IO::Dir' => '0',
-                           'IO::File' => '0',
-                           'Test::More' => '0',
-                           'overload' => '0'
-                         },
-          'INSTALLDIRS' => 'site',
-          'EXE_FILES' => [],
-          'PL_FILES' => {}
-        )
-;
+
+use strict;
+use warnings;
+
+
+
+use ExtUtils::MakeMaker 6.31;
+
+
+
+my %WriteMakefileArgs = (
+  'ABSTRACT' => 'Cross-platform path specification manipulation',
+  'AUTHOR' => 'Ken Williams <kwilliams at cpan.org>',
+  'BUILD_REQUIRES' => {
+    'File::Temp' => '0',
+    'Test::More' => '0'
+  },
+  'CONFIGURE_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.31'
+  },
+  'DISTNAME' => 'Path-Class',
+  'EXE_FILES' => [],
+  'LICENSE' => 'perl',
+  'NAME' => 'Path::Class',
+  'PREREQ_PM' => {
+    'Cwd' => '0',
+    'File::Path' => '0',
+    'File::Spec' => '0.87',
+    'File::Spec::Mac' => '1.3',
+    'File::stat' => '0',
+    'IO::Dir' => '0',
+    'IO::File' => '0',
+    'overload' => '0'
+  },
+  'VERSION' => '0.23',
+  'test' => {
+    'TESTS' => 't/*.t'
+  }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+  my $pp = $WriteMakefileArgs{PREREQ_PM};
+  for my $mod ( keys %$br ) {
+    if ( exists $pp->{$mod} ) {
+      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+    }
+    else {
+      $pp->{$mod} = $br->{$mod};
+    }
+  }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+

Modified: branches/upstream/libpath-class-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/SIGNATURE?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/SIGNATURE (original)
+++ branches/upstream/libpath-class-perl/current/SIGNATURE Mon Dec 27 09:41:39 2010
@@ -1,5 +1,5 @@
 This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
+signed via the Module::Signature module, version 0.66.
 
 To verify the content in this distribution, first make sure you have
 Module::Signature installed, then type:
@@ -15,24 +15,26 @@
 Hash: SHA1
 
 SHA1 3e94b50826015fe7ac1e769cadd656b53317d4ab Build.PL
-SHA1 71955300716dfe44d6e6320b7652a4ba77065cba Changes
+SHA1 1923d4e05cce842d978a78536a958388a3675873 Changes
 SHA1 066a2dba8084a0c2a7e4b6996ad21872bc16beb5 INSTALL
-SHA1 a0a13d88e63cfd5b6f8a6ce1d23838c407b747e0 MANIFEST
-SHA1 acbbdb1d11eb4a93bad7190e7406858265ca8c77 META.yml
-SHA1 13ec5ef969c9758358bdd8b5cd6b71e7e9d775d9 Makefile.PL
+SHA1 f4f533d5ba595558e925934701b6a624c1ae263a MANIFEST
+SHA1 8d450b38f6346a82944f17f0b25be8c8d2a49df7 META.yml
+SHA1 c56ae13703aa3a30404e13a4b321818fc865b8f2 Makefile.PL
 SHA1 a7b1cdcddb8679dff993b475939abcfb73076afb README
-SHA1 644839019a1d8a8bb8d05730b088cc07cb8eb9d8 lib/Path/Class.pm
-SHA1 eb19dfa31e8efe0c557f881de8dfd8c995932d30 lib/Path/Class/Dir.pm
-SHA1 1f960c7f06203dbaf7b8c6cdcf38480d43a0c5a0 lib/Path/Class/Entity.pm
-SHA1 e181b5d22ff222ff935ffd343feffbe89ec9fc74 lib/Path/Class/File.pm
-SHA1 97e2033418d3819f5ebf199d79bf7e87371bf164 t/01-basic.t
+SHA1 b40373e05544adc4447c5fad2509368fc6213b03 dist.ini
+SHA1 e3b4393203382a6a4194a6ec852942f8898c8a61 lib/Path/Class.pm
+SHA1 1aa682b45c70d04aecc6ba2b9cf7402650abbf5a lib/Path/Class/Dir.pm
+SHA1 16c0113abd50b90bb9aa739fa5ee4b549e0ffbe1 lib/Path/Class/Entity.pm
+SHA1 0ea60757f1483cb4287adcdf33c4c8233ba3fd90 lib/Path/Class/File.pm
+SHA1 212c128d87fa012c36016210e6e9213112fc3c23 t/01-basic.t
 SHA1 a42f4b07e4c42e7a59b960b13c5466d7cd82e17a t/02-foreign.t
 SHA1 ff702cdbf0bb4c25959cbc5a5c7db17772b7aa5b t/03-filesystem.t
 SHA1 a163d4cf70142b45974ed39c78571e7ce2ba5a7f t/04-subclass.t
+SHA1 2c32aa5691540466533ae7c06753160f020818e9 t/file-spec-tests
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (Darwin)
 
-iD8DBQFMayXSgrvMBLfvlHYRAkB3AJ4r87RaKT15C1QaKhBsLq0recnG8QCg093p
-s1PCp3v64TPCHdPPkqVK0so=
-=FmKX
+iD8DBQFNF5rDgrvMBLfvlHYRAvbMAJ98sj5UZ5yLj0FkiXyu7P/NHq0vGACgnry1
+iuQgkpeJgSCL7Ljh0hfJRcQ=
+=Fky1
 -----END PGP SIGNATURE-----

Added: branches/upstream/libpath-class-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/dist.ini?rev=66491&op=file
==============================================================================
--- branches/upstream/libpath-class-perl/current/dist.ini (added)
+++ branches/upstream/libpath-class-perl/current/dist.ini Mon Dec 27 09:41:39 2010
@@ -1,0 +1,37 @@
+name    = Path-Class
+version = 0.23
+author  = Ken Williams <kwilliams at cpan.org>
+license = Perl_5
+copyright_holder = Ken Williams
+
+[GatherDir]
+
+[PkgVersion]
+[PodVersion]
+
+[TestRelease]
+[ConfirmRelease]
+[UploadToCPAN]
+
+[MetaYAML]
+[MakeMaker]
+[PruneCruft]
+[Manifest]
+[Signature]
+
+[Bugtracker]
+[Repository]
+
+[Prereqs]
+File::Spec = 0.87
+File::Spec::Mac = 1.3
+IO::Dir = 0
+IO::File = 0
+File::stat = 0
+File::Path = 0
+overload = 0
+Cwd = 0
+
+[Prereqs / TestRequires]
+Test::More = 0
+File::Temp = 0

Modified: branches/upstream/libpath-class-perl/current/lib/Path/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/lib/Path/Class.pm?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/lib/Path/Class.pm (original)
+++ branches/upstream/libpath-class-perl/current/lib/Path/Class.pm Mon Dec 27 09:41:39 2010
@@ -1,6 +1,8 @@
 package Path::Class;
+BEGIN {
+  $Path::Class::VERSION = '0.23';
+}
 
-$VERSION = '0.21';
 @ISA = qw(Exporter);
 @EXPORT    = qw(file dir);
 @EXPORT_OK = qw(file dir foreign_file foreign_dir);
@@ -22,6 +24,10 @@
 =head1 NAME
 
 Path::Class - Cross-platform path specification manipulation
+
+=head1 VERSION
+
+version 0.23
 
 =head1 SYNOPSIS
 
@@ -174,4 +180,4 @@
 
 Path::Class::Dir, Path::Class::File, File::Spec
 
-=cut
+=cut

Modified: branches/upstream/libpath-class-perl/current/lib/Path/Class/Dir.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/lib/Path/Class/Dir.pm?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/lib/Path/Class/Dir.pm (original)
+++ branches/upstream/libpath-class-perl/current/lib/Path/Class/Dir.pm Mon Dec 27 09:41:39 2010
@@ -1,6 +1,7 @@
 package Path::Class::Dir;
-
-$VERSION = '0.21';
+BEGIN {
+  $Path::Class::Dir::VERSION = '0.23';
+}
 
 use strict;
 use Path::Class::File;
@@ -70,6 +71,8 @@
   local $Path::Class::Foreign = $_[0]->{file_spec_class} if $_[0]->{file_spec_class};
   return $_[0]->file_class->new(@_);
 }
+
+sub basename { shift()->{dirs}[-1] }
 
 sub dir_list {
   my $self = shift;
@@ -258,6 +261,10 @@
 
 Path::Class::Dir - Objects representing directories
 
+=head1 VERSION
+
+version 0.23
+
 =head1 SYNOPSIS
 
   use Path::Class qw(dir);  # Export a short constructor
@@ -650,4 +657,4 @@
 
 Path::Class, Path::Class::File, File::Spec
 
-=cut
+=cut

Modified: branches/upstream/libpath-class-perl/current/lib/Path/Class/Entity.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/lib/Path/Class/Entity.pm?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/lib/Path/Class/Entity.pm (original)
+++ branches/upstream/libpath-class-perl/current/lib/Path/Class/Entity.pm Mon Dec 27 09:41:39 2010
@@ -1,6 +1,7 @@
 package Path::Class::Entity;
-
-$VERSION = '0.21';
+BEGIN {
+  $Path::Class::Entity::VERSION = '0.23';
+}
 
 use strict;
 use File::Spec;
@@ -84,3 +85,27 @@
 sub lstat { File::stat::lstat("$_[0]") }
 
 1;
+__END__
+
+=head1 NAME
+
+Path::Class:Entity - Base class for files and directories
+
+=head1 VERSION
+
+version 0.23
+
+=head1 DESCRIPTION
+
+This class is the base class for C<Path::Class::File> and
+C<Path::Class::Dir>, it is not used directly by callers.
+
+=head1 AUTHOR
+
+Ken Williams, kwilliams at cpan.org
+
+=head1 SEE ALSO
+
+Path::Class
+
+=cut

Modified: branches/upstream/libpath-class-perl/current/lib/Path/Class/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/lib/Path/Class/File.pm?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/lib/Path/Class/File.pm (original)
+++ branches/upstream/libpath-class-perl/current/lib/Path/Class/File.pm Mon Dec 27 09:41:39 2010
@@ -1,6 +1,7 @@
 package Path::Class::File;
-
-$VERSION = '0.21';
+BEGIN {
+  $Path::Class::File::VERSION = '0.23';
+}
 
 use strict;
 use Path::Class::Dir;
@@ -100,6 +101,10 @@
 
 Path::Class::File - Objects representing files
 
+=head1 VERSION
+
+version 0.23
+
 =head1 SYNOPSIS
 
   use Path::Class qw(file);  # Export a short constructor
@@ -346,4 +351,4 @@
 
 Path::Class, Path::Class::Dir, File::Spec
 
-=cut
+=cut

Modified: branches/upstream/libpath-class-perl/current/t/01-basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/t/01-basic.t?rev=66491&op=diff
==============================================================================
--- branches/upstream/libpath-class-perl/current/t/01-basic.t (original)
+++ branches/upstream/libpath-class-perl/current/t/01-basic.t Mon Dec 27 09:41:39 2010
@@ -7,7 +7,7 @@
 use Path::Class;
 use Cwd;
 
-plan tests => 66;
+plan tests => 68;
 ok(1);
 
 my $file1 = Path::Class::File->new('foo.txt');
@@ -25,6 +25,7 @@
 my $dir = dir('tmp');
 ok $dir, 'tmp';
 ok $dir->is_absolute, '';
+ok $dir->basename, 'tmp';
 
 my $dir2 = dir('/tmp');
 ok $dir2, '/tmp';
@@ -47,6 +48,7 @@
 $cat = $dir2->subdir('foo');
 ok $cat, '/tmp/foo';
 ok $cat->isa('Path::Class::Dir');
+ok $cat->basename, 'foo';
 
 my $file = file('/foo//baz/./foo')->cleanup;
 ok $file, '/foo/baz/foo';

Added: branches/upstream/libpath-class-perl/current/t/file-spec-tests
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpath-class-perl/current/t/file-spec-tests?rev=66491&op=file
==============================================================================
--- branches/upstream/libpath-class-perl/current/t/file-spec-tests (added)
+++ branches/upstream/libpath-class-perl/current/t/file-spec-tests Mon Dec 27 09:41:39 2010
@@ -1,0 +1,379 @@
+#!./perl
+
+BEGIN {
+    $^O = '';
+#chdir 't' if -d 't';
+#unshift @INC, '../lib';
+}
+
+# Each element in this array is a single test. Storing them this way makes
+# maintenance easy, and should be OK since perl should be pretty functional
+# before these tests are run.
+
+ at tests = (
+# Function                      Expected
+[ "Unix->catfile('a','b','c')", 'a/b/c'  ],
+
+[ "Unix->splitpath('file')",            ',,file'            ],
+[ "Unix->splitpath('/d1/d2/d3/')",      ',/d1/d2/d3/,'      ],
+[ "Unix->splitpath('d1/d2/d3/')",       ',d1/d2/d3/,'       ],
+[ "Unix->splitpath('/d1/d2/d3/.')",     ',/d1/d2/d3/.,'     ],
+[ "Unix->splitpath('/d1/d2/d3/..')",    ',/d1/d2/d3/..,'    ],
+[ "Unix->splitpath('/d1/d2/d3/.file')", ',/d1/d2/d3/,.file' ],
+[ "Unix->splitpath('d1/d2/d3/file')",   ',d1/d2/d3/,file'   ],
+[ "Unix->splitpath('/../../d1/')",      ',/../../d1/,'      ],
+[ "Unix->splitpath('/././d1/')",        ',/././d1/,'        ],
+
+[ "Unix->catpath('','','file')",            'file'            ],
+[ "Unix->catpath('','/d1/d2/d3/','')",      '/d1/d2/d3/'      ],
+[ "Unix->catpath('','d1/d2/d3/','')",       'd1/d2/d3/'       ],
+[ "Unix->catpath('','/d1/d2/d3/.','')",     '/d1/d2/d3/.'     ],
+[ "Unix->catpath('','/d1/d2/d3/..','')",    '/d1/d2/d3/..'    ],
+[ "Unix->catpath('','/d1/d2/d3/','.file')", '/d1/d2/d3/.file' ],
+[ "Unix->catpath('','d1/d2/d3/','file')",   'd1/d2/d3/file'   ],
+[ "Unix->catpath('','/../../d1/','')",      '/../../d1/'      ],
+[ "Unix->catpath('','/././d1/','')",        '/././d1/'        ],
+[ "Unix->catpath('d1','d2/d3/','')",        'd2/d3/'          ],
+[ "Unix->catpath('d1','d2','d3/')",         'd2/d3/'          ],
+
+[ "Unix->splitdir('')",           ''           ],
+[ "Unix->splitdir('/d1/d2/d3/')", ',d1,d2,d3,' ],
+[ "Unix->splitdir('d1/d2/d3/')",  'd1,d2,d3,'  ],
+[ "Unix->splitdir('/d1/d2/d3')",  ',d1,d2,d3'  ],
+[ "Unix->splitdir('d1/d2/d3')",   'd1,d2,d3'   ],
+
+[ "Unix->catdir()",                     ''          ],
+[ "Unix->catdir('/')",                  '/'         ],
+[ "Unix->catdir('','d1','d2','d3','')", '/d1/d2/d3' ],
+[ "Unix->catdir('d1','d2','d3','')",    'd1/d2/d3'  ],
+[ "Unix->catdir('','d1','d2','d3')",    '/d1/d2/d3' ],
+[ "Unix->catdir('d1','d2','d3')",       'd1/d2/d3'  ],
+
+[ "Unix->catfile('a','b','c')", 'a/b/c' ],
+
+[ "Unix->canonpath('')",                                      ''          ],
+[ "Unix->canonpath('///../../..//./././a//b/.././c/././')",   '/a/b/../c' ],
+[ "Unix->canonpath('/.')",                                    '/.'        ],
+
+[  "Unix->abs2rel('/t1/t2/t3','/t1/t2/t3')",          ''                   ],
+[  "Unix->abs2rel('/t1/t2/t4','/t1/t2/t3')",          '../t4'              ],
+[  "Unix->abs2rel('/t1/t2','/t1/t2/t3')",             '..'                 ],
+[  "Unix->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')",       't4'                 ],
+[  "Unix->abs2rel('/t4/t5/t6','/t1/t2/t3')",          '../../../t4/t5/t6'  ],
+#[ "Unix->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
+[  "Unix->abs2rel('/','/t1/t2/t3')",                  '../../..'           ],
+[  "Unix->abs2rel('///','/t1/t2/t3')",                '../../..'           ],
+[  "Unix->abs2rel('/.','/t1/t2/t3')",                 '../../../.'         ],
+[  "Unix->abs2rel('/./','/t1/t2/t3')",                '../../..'           ],
+#[ "Unix->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
+
+[ "Unix->rel2abs('t4','/t1/t2/t3')",             '/t1/t2/t3/t4'    ],
+[ "Unix->rel2abs('t4/t5','/t1/t2/t3')",          '/t1/t2/t3/t4/t5' ],
+[ "Unix->rel2abs('.','/t1/t2/t3')",              '/t1/t2/t3'       ],
+[ "Unix->rel2abs('..','/t1/t2/t3')",             '/t1/t2/t3/..'    ],
+[ "Unix->rel2abs('../t4','/t1/t2/t3')",          '/t1/t2/t3/../t4' ],
+[ "Unix->rel2abs('/t1','/t1/t2/t3')",            '/t1'             ],
+
+[ "Win32->splitpath('file')",                            ',,file'                            ],
+[ "Win32->splitpath('\\d1/d2\\d3/')",                    ',\\d1/d2\\d3/,'                    ],
+[ "Win32->splitpath('d1/d2\\d3/')",                      ',d1/d2\\d3/,'                      ],
+[ "Win32->splitpath('\\d1/d2\\d3/.')",                   ',\\d1/d2\\d3/.,'                   ],
+[ "Win32->splitpath('\\d1/d2\\d3/..')",                  ',\\d1/d2\\d3/..,'                  ],
+[ "Win32->splitpath('\\d1/d2\\d3/.file')",               ',\\d1/d2\\d3/,.file'               ],
+[ "Win32->splitpath('\\d1/d2\\d3/file')",                ',\\d1/d2\\d3/,file'                ],
+[ "Win32->splitpath('d1/d2\\d3/file')",                  ',d1/d2\\d3/,file'                  ],
+[ "Win32->splitpath('C:\\d1/d2\\d3/')",                  'C:,\\d1/d2\\d3/,'                  ],
+[ "Win32->splitpath('C:d1/d2\\d3/')",                    'C:,d1/d2\\d3/,'                    ],
+[ "Win32->splitpath('C:\\d1/d2\\d3/file')",              'C:,\\d1/d2\\d3/,file'              ],
+[ "Win32->splitpath('C:d1/d2\\d3/file')",                'C:,d1/d2\\d3/,file'                ],
+[ "Win32->splitpath('C:\\../d2\\d3/file')",              'C:,\\../d2\\d3/,file'              ],
+[ "Win32->splitpath('C:../d2\\d3/file')",                'C:,../d2\\d3/,file'                ],
+[ "Win32->splitpath('\\../..\\d1/')",                    ',\\../..\\d1/,'                    ],
+[ "Win32->splitpath('\\./.\\d1/')",                      ',\\./.\\d1/,'                      ],
+[ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/')",     '\\\\node\\share,\\d1/d2\\d3/,'     ],
+[ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/file')", '\\\\node\\share,\\d1/d2\\d3/,file' ],
+[ "Win32->splitpath('\\\\node\\share\\d1/d2\\file')",    '\\\\node\\share,\\d1/d2\\,file'    ],
+[ "Win32->splitpath('file',1)",                          ',file,'                            ],
+[ "Win32->splitpath('\\d1/d2\\d3/',1)",                  ',\\d1/d2\\d3/,'                    ],
+[ "Win32->splitpath('d1/d2\\d3/',1)",                    ',d1/d2\\d3/,'                      ],
+[ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/',1)",   '\\\\node\\share,\\d1/d2\\d3/,'     ],
+
+[ "Win32->catpath('','','file')",                            'file'                            ],
+[ "Win32->catpath('','\\d1/d2\\d3/','')",                    '\\d1/d2\\d3/'                    ],
+[ "Win32->catpath('','d1/d2\\d3/','')",                      'd1/d2\\d3/'                      ],
+[ "Win32->catpath('','\\d1/d2\\d3/.','')",                   '\\d1/d2\\d3/.'                   ],
+[ "Win32->catpath('','\\d1/d2\\d3/..','')",                  '\\d1/d2\\d3/..'                  ],
+[ "Win32->catpath('','\\d1/d2\\d3/','.file')",               '\\d1/d2\\d3/.file'               ],
+[ "Win32->catpath('','\\d1/d2\\d3/','file')",                '\\d1/d2\\d3/file'                ],
+[ "Win32->catpath('','d1/d2\\d3/','file')",                  'd1/d2\\d3/file'                  ],
+[ "Win32->catpath('C:','\\d1/d2\\d3/','')",                  'C:\\d1/d2\\d3/'                  ],
+[ "Win32->catpath('C:','d1/d2\\d3/','')",                    'C:d1/d2\\d3/'                    ],
+[ "Win32->catpath('C:','\\d1/d2\\d3/','file')",              'C:\\d1/d2\\d3/file'              ],
+[ "Win32->catpath('C:','d1/d2\\d3/','file')",                'C:d1/d2\\d3/file'                ],
+[ "Win32->catpath('C:','\\../d2\\d3/','file')",              'C:\\../d2\\d3/file'              ],
+[ "Win32->catpath('C:','../d2\\d3/','file')",                'C:../d2\\d3/file'                ],
+[ "Win32->catpath('','\\../..\\d1/','')",                    '\\../..\\d1/'                    ],
+[ "Win32->catpath('','\\./.\\d1/','')",                      '\\./.\\d1/'                      ],
+[ "Win32->catpath('\\\\node\\share','\\d1/d2\\d3/','')",     '\\\\node\\share\\d1/d2\\d3/'     ],
+[ "Win32->catpath('\\\\node\\share','\\d1/d2\\d3/','file')", '\\\\node\\share\\d1/d2\\d3/file' ],
+[ "Win32->catpath('\\\\node\\share','\\d1/d2\\','file')",    '\\\\node\\share\\d1/d2\\file'    ],
+
+[ "Win32->splitdir('')",             ''           ],
+[ "Win32->splitdir('\\d1/d2\\d3/')", ',d1,d2,d3,' ],
+[ "Win32->splitdir('d1/d2\\d3/')",   'd1,d2,d3,'  ],
+[ "Win32->splitdir('\\d1/d2\\d3')",  ',d1,d2,d3'  ],
+[ "Win32->splitdir('d1/d2\\d3')",    'd1,d2,d3'   ],
+
+[ "Win32->catdir()",                        ''                   ],
+[ "Win32->catdir('')",                      '\\'                 ],
+[ "Win32->catdir('/')",                     '\\'                 ],
+[ "Win32->catdir('//d1','d2')",             '\\\\d1\\d2'         ],
+[ "Win32->catdir('','/d1','d2')",           '\\\\d1\\d2'         ],
+[ "Win32->catdir('','','/d1','d2')",        '\\\\\\d1\\d2'       ],
+[ "Win32->catdir('','//d1','d2')",          '\\\\\\d1\\d2'       ],
+[ "Win32->catdir('','','//d1','d2')",       '\\\\\\\\d1\\d2'     ],
+[ "Win32->catdir('','d1','','d2','')",      '\\d1\\d2'           ],
+[ "Win32->catdir('','d1','d2','d3','')",    '\\d1\\d2\\d3'       ],
+[ "Win32->catdir('d1','d2','d3','')",       'd1\\d2\\d3'         ],
+[ "Win32->catdir('','d1','d2','d3')",       '\\d1\\d2\\d3'       ],
+[ "Win32->catdir('d1','d2','d3')",          'd1\\d2\\d3'         ],
+[ "Win32->catdir('A:/d1','d2','d3')",       'A:\\d1\\d2\\d3'     ],
+[ "Win32->catdir('A:/d1','d2','d3','')",    'A:\\d1\\d2\\d3'     ],
+#[ "Win32->catdir('A:/d1','B:/d2','d3','')", 'A:\\d1\\d2\\d3'     ],
+[ "Win32->catdir('A:/d1','B:/d2','d3','')", 'A:\\d1\\B:\\d2\\d3' ],
+[ "Win32->catdir('A:/')",                   'A:\\'               ],
+
+[ "Win32->catfile('a','b','c')", 'a\\b\\c' ],
+
+[ "Win32->canonpath('')",               ''                    ],
+[ "Win32->canonpath('a:')",             'A:'                  ],
+[ "Win32->canonpath('A:f')",            'A:f'                 ],
+[ "Win32->canonpath('//a\\b//c')",      '\\\\a\\b\\c'         ],
+[ "Win32->canonpath('/a/..../c')",      '\\a\\....\\c'        ],
+[ "Win32->canonpath('//a/b\\c')",       '\\\\a\\b\\c'         ],
+[ "Win32->canonpath('////')",           '\\\\\\'              ],
+[ "Win32->canonpath('//')",             '\\'                  ],
+[ "Win32->canonpath('/.')",             '\\.'                 ],
+[ "Win32->canonpath('//a/b/../../c')",  '\\\\a\\b\\..\\..\\c' ],
+[ "Win32->canonpath('//a/../../c')",    '\\\\a\\..\\..\\c'    ],
+
+[  "Win32->abs2rel('/t1/t2/t3','/t1/t2/t3')",    ''                       ],
+[  "Win32->abs2rel('/t1/t2/t4','/t1/t2/t3')",    '..\\t4'                 ],
+[  "Win32->abs2rel('/t1/t2','/t1/t2/t3')",       '..'                     ],
+[  "Win32->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')", 't4'                     ],
+[  "Win32->abs2rel('/t4/t5/t6','/t1/t2/t3')",    '..\\..\\..\\t4\\t5\\t6' ],
+#[ "Win32->abs2rel('../t4','/t1/t2/t3')",        '\\t1\\t2\\t3\\..\\t4'   ],
+[  "Win32->abs2rel('/','/t1/t2/t3')",            '..\\..\\..'             ],
+[  "Win32->abs2rel('///','/t1/t2/t3')",          '..\\..\\..'             ],
+[  "Win32->abs2rel('/.','/t1/t2/t3')",           '..\\..\\..\\.'          ],
+[  "Win32->abs2rel('/./','/t1/t2/t3')",          '..\\..\\..'             ],
+[  "Win32->abs2rel('\\\\a/t1/t2/t4','/t2/t3')",  '..\\t4'                 ],
+[  "Win32->abs2rel('//a/t1/t2/t4','/t2/t3')",    '..\\t4'                 ],
+
+[ "Win32->rel2abs('temp','C:/')",                       'C:\\temp'                        ],
+[ "Win32->rel2abs('temp','C:/a')",                      'C:\\a\\temp'                     ],
+[ "Win32->rel2abs('temp','C:/a/')",                     'C:\\a\\temp'                     ],
+[ "Win32->rel2abs('../','C:/')",                        'C:\\..'                          ],
+[ "Win32->rel2abs('../','C:/a')",                       'C:\\a\\..'                       ],
+[ "Win32->rel2abs('temp','//prague_main/work/')",       '\\\\prague_main\\work\\temp'     ],
+[ "Win32->rel2abs('../temp','//prague_main/work/')",    '\\\\prague_main\\work\\..\\temp' ],
+[ "Win32->rel2abs('temp','//prague_main/work')",        '\\\\prague_main\\work\\temp'     ],
+[ "Win32->rel2abs('../','//prague_main/work')",         '\\\\prague_main\\work\\..'       ],
+
+[ "VMS->splitpath('file')",                                       ',,file'                                   ],
+[ "VMS->splitpath('[d1.d2.d3]')",                                 ',[d1.d2.d3],'                               ],
+[ "VMS->splitpath('[.d1.d2.d3]')",                                ',[.d1.d2.d3],'                              ],
+[ "VMS->splitpath('[d1.d2.d3]file')",                             ',[d1.d2.d3],file'                           ],
+[ "VMS->splitpath('d1/d2/d3/file')",                              ',[.d1.d2.d3],file'                          ],
+[ "VMS->splitpath('/d1/d2/d3/file')",                             'd1:,[d2.d3],file'                         ],
+[ "VMS->splitpath('[.d1.d2.d3]file')",                            ',[.d1.d2.d3],file'                          ],
+[ "VMS->splitpath('node::volume:[d1.d2.d3]')",                    'node::volume:,[d1.d2.d3],'                  ],
+[ "VMS->splitpath('node::volume:[d1.d2.d3]file')",                'node::volume:,[d1.d2.d3],file'              ],
+[ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]')",     'node"access_spec"::volume:,[d1.d2.d3],'     ],
+[ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]file')", 'node"access_spec"::volume:,[d1.d2.d3],file' ],
+
+[ "VMS->catpath('','','file')",                                       'file'                                     ],
+[ "VMS->catpath('','[d1.d2.d3]','')",                                 '[d1.d2.d3]'                               ],
+[ "VMS->catpath('','[.d1.d2.d3]','')",                                '[.d1.d2.d3]'                              ],
+[ "VMS->catpath('','[d1.d2.d3]','file')",                             '[d1.d2.d3]file'                           ],
+[ "VMS->catpath('','[.d1.d2.d3]','file')",                            '[.d1.d2.d3]file'                          ],
+[ "VMS->catpath('','d1/d2/d3','file')",                               '[.d1.d2.d3]file'                            ],
+[ "VMS->catpath('v','d1/d2/d3','file')",                              'v:[.d1.d2.d3]file'                            ],
+[ "VMS->catpath('node::volume:','[d1.d2.d3]','')",                    'node::volume:[d1.d2.d3]'                  ],
+[ "VMS->catpath('node::volume:','[d1.d2.d3]','file')",                'node::volume:[d1.d2.d3]file'              ],
+[ "VMS->catpath('node\"access_spec\"::volume:','[d1.d2.d3]','')",     'node"access_spec"::volume:[d1.d2.d3]'     ],
+[ "VMS->catpath('node\"access_spec\"::volume:','[d1.d2.d3]','file')", 'node"access_spec"::volume:[d1.d2.d3]file' ],
+
+[ "VMS->canonpath('')",                                    ''                        ],
+[ "VMS->canonpath('volume:[d1]file')",                     'volume:[d1]file'         ],
+[ "VMS->canonpath('volume:[d1.-.d2.][d3.d4.-]')",              'volume:[d2.d3]'          ],
+[ "VMS->canonpath('volume:[000000.d1]d2.dir;1')",                 'volume:[d1]d2.dir;1'   ],
+
+[ "VMS->splitdir('')",            ''          ],
+[ "VMS->splitdir('[]')",          ''          ],
+[ "VMS->splitdir('d1.d2.d3')",    'd1,d2,d3'  ],
+[ "VMS->splitdir('[d1.d2.d3]')",  'd1,d2,d3'  ],
+[ "VMS->splitdir('.d1.d2.d3')",   ',d1,d2,d3' ],
+[ "VMS->splitdir('[.d1.d2.d3]')", ',d1,d2,d3' ],
+[ "VMS->splitdir('.-.d2.d3')",    ',-,d2,d3'  ],
+[ "VMS->splitdir('[.-.d2.d3]')",  ',-,d2,d3'  ],
+
+[ "VMS->catdir('')",                                                      ''                 ],
+[ "VMS->catdir('d1','d2','d3')",                                          '[.d1.d2.d3]'         ],
+[ "VMS->catdir('d1','d2/','d3')",                                         '[.d1.d2.d3]'         ],
+[ "VMS->catdir('','d1','d2','d3')",                                       '[.d1.d2.d3]'        ],
+[ "VMS->catdir('','-','d2','d3')",                                        '[-.d2.d3]'         ],
+[ "VMS->catdir('','-','','d3')",                                          '[-.d3]'            ],
+[ "VMS->catdir('dir.dir','d2.dir','d3.dir')",                             '[.dir.d2.d3]'        ],
+[ "VMS->catdir('[.name]')",                                               '[.name]'            ],
+[ "VMS->catdir('[.name]','[.name]')",                                     '[.name.name]'],    
+
+[  "VMS->abs2rel('node::volume:[t1.t2.t3]','[t1.t2.t3]')", ''                 ],
+[  "VMS->abs2rel('node::volume:[t1.t2.t4]','[t1.t2.t3]')", '[-.t4]'           ],
+[  "VMS->abs2rel('[t1.t2.t3]','[t1.t2.t3]')",              ''                 ],
+[  "VMS->abs2rel('[t1.t2.t3]file','[t1.t2.t3]')",          'file'             ],
+[  "VMS->abs2rel('[t1.t2.t4]','[t1.t2.t3]')",              '[-.t4]'           ],
+[  "VMS->abs2rel('[t1.t2]file','[t1.t2.t3]')",             '[-]file'          ],
+[  "VMS->abs2rel('[t1.t2.t3.t4]','[t1.t2.t3]')",           '[t4]'             ],
+[  "VMS->abs2rel('[t4.t5.t6]','[t1.t2.t3]')",              '[---.t4.t5.t6]'   ],
+[ "VMS->abs2rel('[000000]','[t1.t2.t3]')",                 '[---.000000]'     ],
+[ "VMS->abs2rel('a:[t1.t2.t4]','[t1.t2.t3]')",             '[-.t4]'           ],
+[ "VMS->abs2rel('[a.-.b.c.-]','[t1.t2.t3]')",              '[---.b]'          ],
+
+[ "VMS->rel2abs('[.t4]','[t1.t2.t3]')",          '[t1.t2.t3.t4]'    ],
+[ "VMS->rel2abs('[.t4.t5]','[t1.t2.t3]')",       '[t1.t2.t3.t4.t5]' ],
+[ "VMS->rel2abs('[]','[t1.t2.t3]')",             '[t1.t2.t3]'       ],
+[ "VMS->rel2abs('[-]','[t1.t2.t3]')",            '[t1.t2]'          ],
+[ "VMS->rel2abs('[-.t4]','[t1.t2.t3]')",         '[t1.t2.t4]'       ],
+[ "VMS->rel2abs('[t1]','[t1.t2.t3]')",           '[t1]'             ],
+
+[ "OS2->catdir('A:/d1','B:/d2','d3','')", 'A:/d1/B:/d2/d3' ],
+[ "OS2->catfile('a','b','c')",            'a/b/c'          ],
+
+[ "Mac->splitpath('file')",          ',,file'          ],
+[ "Mac->splitpath(':file')",         ',:,file'         ],
+[ "Mac->splitpath(':d1',1)",         ',:d1:,'          ],
+[ "Mac->splitpath('d1',1)",          'd1:,,'           ],
+[ "Mac->splitpath('d1:d2:d3:')",     'd1:,d2:d3:,'     ],
+[ "Mac->splitpath('d1:d2:d3',1)",    'd1:,d2:d3:,'     ],
+[ "Mac->splitpath(':d1:d2:d3:')",    ',:d1:d2:d3:,'    ],
+[ "Mac->splitpath(':d1:d2:d3:',1)",  ',:d1:d2:d3:,'    ],
+[ "Mac->splitpath('d1:d2:d3:file')", 'd1:,d2:d3:,file' ],
+[ "Mac->splitpath('d1:d2:d3',1)",    'd1:,d2:d3:,'     ],
+
+[ "Mac->catdir('')",                ':'           ],
+[ "Mac->catdir('d1','d2','d3')",    'd1:d2:d3:'   ],
+[ "Mac->catdir('d1','d2/','d3')",   'd1:d2/:d3:'  ],
+[ "Mac->catdir('','d1','d2','d3')", ':d1:d2:d3:'  ],
+[ "Mac->catdir('','','d2','d3')",   '::d2:d3:'    ],
+[ "Mac->catdir('','','','d3')",     ':::d3:'      ],
+[ "Mac->catdir(':name')",           ':name:'      ],
+[ "Mac->catdir(':name',':name')",   ':name:name:' ],
+
+[ "Mac->catfile('a','b','c')", 'a:b:c' ],
+
+[ "Mac->canonpath('')",                   ''     ],
+[ "Mac->canonpath(':')",                  ':'    ],
+[ "Mac->canonpath('::')",                 '::'   ],
+[ "Mac->canonpath('a::')",                'a::'  ],
+[ "Mac->canonpath(':a::')",               ':a::' ],
+
+[ "Mac->abs2rel('t1:t2:t3','t1:t2:t3')",    ':'            ],
+[ "Mac->abs2rel('t1:t2','t1:t2:t3')",       '::'           ],
+[ "Mac->abs2rel('t1:t4','t1:t2:t3')",       ':::t4'        ],
+[ "Mac->abs2rel('t1:t2:t4','t1:t2:t3')",    '::t4'         ],
+[ "Mac->abs2rel('t1:t2:t3:t4','t1:t2:t3')", ':t4'          ],
+[ "Mac->abs2rel('t4:t5:t6','t1:t2:t3')",    '::::t4:t5:t6' ],
+[ "Mac->abs2rel('t1','t1:t2:t3')",          ':::'          ],
+
+[ "Mac->rel2abs(':t4','t1:t2:t3')",          't1:t2:t3:t4'    ],
+[ "Mac->rel2abs(':t4:t5','t1:t2:t3')",       't1:t2:t3:t4:t5' ],
+[ "Mac->rel2abs('','t1:t2:t3')",             ''               ],
+[ "Mac->rel2abs('::','t1:t2:t3')",           't1:t2:t3::'     ],
+[ "Mac->rel2abs('::t4','t1:t2:t3')",         't1:t2:t3::t4'   ],
+[ "Mac->rel2abs('t1','t1:t2:t3')",           't1'             ],
+) ;
+
+# Grab all of the plain routines from File::Spec
+use File::Spec @File::Spec::EXPORT_OK ;
+
+require File::Spec::Unix ;
+require File::Spec::Win32 ;
+
+eval {
+   require VMS::Filespec ;
+} ;
+
+my $skip_exception = "Install VMS::Filespec (from vms/ext)" ;
+
+if ( $@ ) {
+   # Not pretty, but it allows testing of things not implemented soley
+   # on VMS.  It might be better to change File::Spec::VMS to do this,
+   # making it more usable when running on (say) Unix but working with
+   # VMS paths.
+   eval qq-
+      sub File::Spec::VMS::vmsify  { die "$skip_exception" }
+      sub File::Spec::VMS::unixify { die "$skip_exception" }
+      sub File::Spec::VMS::vmspath { die "$skip_exception" }
+   - ;
+   $INC{"VMS/Filespec.pm"} = 1 ;
+}
+require File::Spec::VMS ;
+
+require File::Spec::OS2 ;
+require File::Spec::Mac ;
+
+print "1..", scalar( @tests ), "\n" ;
+
+my $current_test= 1 ;
+
+# Test out the class methods
+for ( @tests ) {
+   tryfunc( @$_ ) ;
+}
+
+
+
+#
+# Tries a named function with the given args and compares the result against
+# an expected result. Works with functions that return scalars or arrays.
+#
+sub tryfunc {
+    my $function = shift ;
+    my $expected = shift ;
+    my $platform = shift ;
+
+    if ($platform && $^O ne $platform) {
+	print "ok $current_test # skipped: $function\n" ;
+	++$current_test ;
+	return;
+    }
+
+    $function =~ s#\\#\\\\#g ;
+
+    my $got ;
+    if ( $function =~ /^[^\$].*->/ ) {
+	$got = eval( "join( ',', File::Spec::$function )" ) ;
+    }
+    else {
+	$got = eval( "join( ',', $function )" ) ;
+    }
+
+    if ( $@ ) {
+        if ( substr( $@, 0, length $skip_exception ) eq $skip_exception ) {
+	    chomp $@ ;
+	    print "ok $current_test # skip $function: $@\n" ;
+	}
+	else {
+	    chomp $@ ;
+	    print "not ok $current_test # $function: $@\n" ;
+	}
+    }
+    elsif ( !defined( $got ) || $got ne $expected ) {
+	print "not ok $current_test # $function: got '$got', expected '$expected'\n" ;
+    }
+    else {
+	print "ok $current_test # $function\n" ;
+    }
+    ++$current_test ;
+}




More information about the Pkg-perl-cvs-commits mailing list