From 62bab7fc22ed4668fc2cca4b85965644046a1169 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 26 May 2012 07:24:59 +0000 Subject: test/ruby/test_file.rb: fix for UNC * test/ruby/test_file.rb (test_realpath, test_realdirpath): fix for UNC enabled platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index f94e4336d7..b9c2210bdf 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -213,7 +213,7 @@ class TestFile < Test::Unit::TestCase 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 @@ class TestFile < Test::Unit::TestCase 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)) -- cgit v1.2.3