summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 10:19:51 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 10:19:51 +0000
commit51f64b032a93d9521962e0ea11fa77536c8df602 (patch)
treec76840149834c910357895d737fee181c4388413 /test
parent4701a70b31fdb07f560822d79b1d1f0742a82afb (diff)
merge revision(s) 37692,37700,37706: [Backport #7381]
* win32/file.c (replace_to_long_name): skip automatic path expansion when wildcard character is used. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add a test for above. * win32/file.c (replace_to_long_name): skip expansion for all wildcard characters. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add more assertions to test. * win32/file.c (replace_to_long_name): correct logic around wildcard characters detection and ensure wide-chars are used as pattern. [ruby-core:49451] [Bug #7374] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index f3c36aa38b..d80c430bce 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -601,6 +601,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal("#{DRIVE}/dir", File.expand_path("#{DRIVE}/./dir"))
end
+ def test_expand_path_does_not_expand_wildcards
+ assert_equal("#{DRIVE}/*", File.expand_path("./*", "#{DRIVE}/"))
+ assert_equal("#{Dir.pwd}/*", File.expand_path("./*", Dir.pwd))
+ assert_equal("#{DRIVE}/?", File.expand_path("./?", "#{DRIVE}/"))
+ assert_equal("#{Dir.pwd}/?", File.expand_path("./?", Dir.pwd))
+ end if DRIVE
+
def test_expand_path_does_not_modify_the_string_argument
str = "./a/b/../c"
assert_equal("#{Dir.pwd}/a/c", File.expand_path(str, Dir.pwd))