[前][次][番号順一覧][スレッド一覧]

ruby-changes:15350

From: nobu <ko1@a...>
Date: Wed, 7 Apr 2010 02:08:39 +0900 (JST)
Subject: [ruby-changes:15350] Ruby:r27240 (trunk): * test/ruby/test_path.rb (TestPath#test_extname): trailing spaces

nobu	2010-04-07 02:05:50 +0900 (Wed, 07 Apr 2010)

  New Revision: 27240

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27240

  Log:
    * test/ruby/test_path.rb (TestPath#test_extname): trailing spaces
      and dots are ignored on NTFS.

  Modified files:
    trunk/test/ruby/test_path.rb

Index: test/ruby/test_path.rb
===================================================================
--- test/ruby/test_path.rb	(revision 27239)
+++ test/ruby/test_path.rb	(revision 27240)
@@ -226,8 +226,13 @@
 
   def test_extname
     assert_equal('', File.extname('a'))
-    assert_equal('.rb', File.extname('a.rb'))
-    assert_equal('', File.extname('a.rb.'))
+    ext = '.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('.x'))
     assert_equal('', File.extname('..x'))

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]