This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Close the filehandle actually being tested in uni/readline.t
[perl5.git] / lib / File / Basename.t
old mode 100755 (executable)
new mode 100644 (file)
index 84e1a4e..0d3b633
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-use Test::More tests => 60;
+use Test::More tests => 64;
 
 BEGIN { use_ok 'File::Basename' }
 
@@ -142,6 +142,17 @@ can_ok( __PACKAGE__, qw( basename fileparse dirname fileparse_set_fstype ) );
 }
 
 
+### basename(1) sez: "The suffix is not stripped if it is identical to the
+### remaining characters in string"
+{
+    fileparse_set_fstype('Unix');
+    is(basename('.foo'), '.foo');
+    is(basename('.foo', '.foo'),     '.foo');
+    is(basename('.foo.bar', '.foo'), '.foo.bar');
+    is(basename('.foo.bar', '.bar'), '.foo');
+}
+
+
 ### Test tainting
 {
     #   The empty tainted value, for tainting strings