diff options
author | NAKAMURA Usaku <[email protected]> | 2019-12-23 11:54:25 +0900 |
---|---|---|
committer | NAKAMURA Usaku <[email protected]> | 2019-12-23 11:54:25 +0900 |
commit | 204dc3f39f12b4e2640555306bd1dd4530344277 (patch) | |
tree | 1532d86db7caeb9b6f5b74b3602918ceb04e11a4 /test/ruby/test_path.rb | |
parent | 048f797bf019cdf303d70494fba63d4a4e606462 (diff) |
Revert "Should return "." for File.extname("file.") also on Windows"
We want to introduce consistency and better compatibility with unixen,
but the Windows APIs doues not have consistency fundamentally and
we can not found any logical way...
This reverts commit 61aff0cd189e67fa6f2565639ad0128fa33b88fc.
Diffstat (limited to 'test/ruby/test_path.rb')
-rw-r--r-- | test/ruby/test_path.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb index 64111ee805..b35e942a2a 100644 --- a/test/ruby/test_path.rb +++ b/test/ruby/test_path.rb @@ -239,7 +239,11 @@ class TestPath < Test::Unit::TestCase 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 |