ruby-changes:23754
From: nobu <ko1@a...>
Date: Sat, 26 May 2012 16:25:08 +0900 (JST)
Subject: [ruby-changes:23754] nobu:r35805 (trunk): test/ruby/test_file.rb: fix for UNC
nobu 2012-05-26 16:24:59 +0900 (Sat, 26 May 2012) New Revision: 35805 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35805 Log: test/ruby/test_file.rb: fix for UNC * test/ruby/test_file.rb (test_realpath, test_realdirpath): fix for UNC enabled platforms. Modified files: trunk/test/ruby/test_file.rb Index: test/ruby/test_file.rb =================================================================== --- test/ruby/test_file.rb (revision 35804) +++ test/ruby/test_file.rb (revision 35805) @@ -213,7 +213,7 @@ def test_realpath Dir.mktmpdir('rubytest-realpath') {|tmpdir| realdir = File.realpath(tmpdir) - tst = realdir.sub(/#{Regexp.escape(File::SEPARATOR)}/, '\0\0\0') + tst = realdir + (File::SEPARATOR*3 + ".") assert_equal(realdir, File.realpath(tst)) assert_equal(realdir, File.realpath(".", tst)) if File::ALT_SEPARATOR @@ -226,7 +226,7 @@ def test_realdirpath Dir.mktmpdir('rubytest-realdirpath') {|tmpdir| realdir = File.realpath(tmpdir) - tst = realdir.sub(/#{Regexp.escape(File::SEPARATOR)}/, '\0\0\0') + tst = realdir + (File::SEPARATOR*3 + ".") assert_equal(realdir, File.realdirpath(tst)) assert_equal(realdir, File.realdirpath(".", tst)) assert_equal(File.join(realdir, "foo"), File.realdirpath("foo", tst)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/