From 51f64b032a93d9521962e0ea11fa77536c8df602 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 11 Dec 2012 10:19:51 +0000 Subject: 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 --- test/ruby/test_file_exhaustive.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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)) -- cgit v1.2.3