mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_path.rb (TestPath#test_extname): trailing spaces
and dots are ignored on NTFS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2e507f34e0
commit
7dd103822b
1 changed files with 7 additions and 2 deletions
|
@ -226,8 +226,13 @@ class TestPath < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_extname
|
def test_extname
|
||||||
assert_equal('', File.extname('a'))
|
assert_equal('', File.extname('a'))
|
||||||
assert_equal('.rb', File.extname('a.rb'))
|
ext = '.rb'
|
||||||
assert_equal('', File.extname('a.rb.'))
|
assert_equal(ext, File.extname('a.rb'))
|
||||||
|
unless /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
# trailing spaces and dots are ignored on NTFS.
|
||||||
|
ext = ''
|
||||||
|
end
|
||||||
|
assert_equal(ext, File.extname('a.rb.'))
|
||||||
assert_equal('', File.extname('a.'))
|
assert_equal('', File.extname('a.'))
|
||||||
assert_equal('', File.extname('.x'))
|
assert_equal('', File.extname('.x'))
|
||||||
assert_equal('', File.extname('..x'))
|
assert_equal('', File.extname('..x'))
|
||||||
|
|
Loading…
Reference in a new issue