diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-17 14:42:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-17 18:51:51 +0900 |
commit | e169ad93f44e1944ecf7bb65133fd34e8b868ea8 (patch) | |
tree | 82c3badab1865e5036dd054dcb15b7fdc3f7c61e /test/ruby/test_path.rb | |
parent | 2a261909cc6d0767d584c0555a1c6594aacf567a (diff) |
Fixed File.extname at a name ending with a dot
File.extname now returns a dot string at a name ending with a dot.
[Bug #15267]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2565
Diffstat (limited to 'test/ruby/test_path.rb')
-rw-r--r-- | test/ruby/test_path.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb index 6af4fb6ac0..b35e942a2a 100644 --- a/test/ruby/test_path.rb +++ b/test/ruby/test_path.rb @@ -236,10 +236,14 @@ class TestPath < Test::Unit::TestCase 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 |