summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-26 07:24:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-26 07:24:59 +0000
commit62bab7fc22ed4668fc2cca4b85965644046a1169 (patch)
treeb1327de90cd048b619ee800eab4bc97d65bf7fb1
parent9c3d8bb0f26762d6809501a38be773de685764f0 (diff)
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
-rw-r--r--test/ruby/test_file.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index f94e4336d7a..b9c2210bdfe 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))