summaryrefslogtreecommitdiff
path: root/test/ruby/test_path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_path.rb')
-rw-r--r--test/ruby/test_path.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb
index 2db7be0b76..b35e942a2a 100644
--- a/test/ruby/test_path.rb
+++ b/test/ruby/test_path.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: false
require 'test/unit'
class TestPath < Test::Unit::TestCase
@@ -230,12 +231,19 @@ class TestPath < Test::Unit::TestCase
assert_equal('', File.extname('a'))
ext = '.rb'
assert_equal(ext, File.extname('a.rb'))
+ assert_equal(ext, File.extname('.a.rb'))
+ assert_equal(ext, File.extname('a/b/d/test.rb'))
+ assert_equal(ext, File.extname('.a/b/d/test.rb'))
unless /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
# trailing spaces and dots are ignored on NTFS.
- ext = ''
+ ext = '.'
end
assert_equal(ext, File.extname('a.rb.'))
- assert_equal('', File.extname('a.'))
+ if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
+ # trailing spaces and dots are ignored on NTFS.
+ ext = ''
+ end
+ assert_equal(ext, File.extname('a.'))
assert_equal('', File.extname('.x'))
assert_equal('', File.extname('..x'))
end