ruby-changes:22454
From: naruse <ko1@a...>
Date: Thu, 9 Feb 2012 11:23:27 +0900 (JST)
Subject: [ruby-changes:22454] naruse:r34503 (ruby_1_9_3): merge revision(s) 34338-34340: [Backport #5909]
naruse 2012-02-09 11:23:16 +0900 (Thu, 09 Feb 2012) New Revision: 34503 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34503 Log: merge revision(s) 34338-34340: [Backport #5909] * test/ruby/test_file_exhaustive.rb (test_expand_path): add tests for absolute paths and drive letters. [ruby-core:42177] * test/ruby/test_file_exhaustive.rb (test_expand_path): ignore case of paths on DOSISH platforms. * test/ruby/test_file_exhaustive.rb (test_expand_path): fix commit miss, removed surplus downcase. Modified files: branches/ruby_1_9_3/test/ruby/test_file_exhaustive.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 34502) +++ ruby_1_9_3/version.h (revision 34503) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 72 +#define RUBY_PATCHLEVEL 73 #define RUBY_RELEASE_DATE "2012-02-09" #define RUBY_RELEASE_YEAR 2012 Index: ruby_1_9_3/test/ruby/test_file_exhaustive.rb =================================================================== --- ruby_1_9_3/test/ruby/test_file_exhaustive.rb (revision 34502) +++ ruby_1_9_3/test/ruby/test_file_exhaustive.rb (revision 34503) @@ -397,7 +397,16 @@ assert_equal(@file, File.expand_path(@file + ".")) assert_equal(@file, File.expand_path(@file + "::$DATA")) assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]') + assert_match(/\Ac:\//i, File.expand_path('c:foo', 'd:/bar')) + assert_match(%r'\Ac:/bar/foo\z'i, File.expand_path('c:foo', 'c:/bar')) end + if drive = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i] + assert_match(%r"\Az:/foo\z"i, File.expand_path('/foo', "z:/bar")) + assert_match(%r"\A//host/share/foo\z"i, File.expand_path('/foo', "//host/share/bar")) + assert_match(%r"\A#{drive}/foo\z"i, File.expand_path('/foo')) + else + assert_equal("/foo", File.expand_path('/foo')) + end assert_kind_of(String, File.expand_path("~")) if ENV["HOME"] assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") } assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/