ruby-changes:15697
From: usa <ko1@a...>
Date: Wed, 5 May 2010 01:02:31 +0900 (JST)
Subject: [ruby-changes:15697] Ruby:r27617 (trunk): * test/ruby/test_require.rb (test_relative_symlink): skip if symlink is not
usa 2010-05-05 01:02:17 +0900 (Wed, 05 May 2010) New Revision: 27617 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27617 Log: * test/ruby/test_require.rb (test_relative_symlink): skip if symlink is not implemented. * test/ruby/test_file_exhaustive.rb (test_stat, test_expand_path): ignore tests about nlink on Windows because its not imeplented because of performance problem. Modified files: trunk/test/ruby/test_file_exhaustive.rb trunk/test/ruby/test_require.rb Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 27616) +++ test/ruby/test_require.rb (revision 27617) @@ -290,9 +290,13 @@ File.open("a/lib.rb", "w") {|f| f.puts 'puts "a/lib.rb"' } File.open("b/lib.rb", "w") {|f| f.puts 'puts "b/lib.rb"' } File.open("a/tst.rb", "w") {|f| f.puts 'require_relative "lib"' } - File.symlink("../a/tst.rb", "b/tst.rb") - result = IO.popen([EnvUtil.rubybin, "b/tst.rb"]).read - assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]") + begin + File.symlink("../a/tst.rb", "b/tst.rb") + result = IO.popen([EnvUtil.rubybin, "b/tst.rb"]).read + assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]") + rescue NotImplementedError + skip "File.symlink is not implemented" + end } } end Index: test/ruby/test_file_exhaustive.rb =================================================================== --- test/ruby/test_file_exhaustive.rb (revision 27616) +++ test/ruby/test_file_exhaustive.rb (revision 27617) @@ -83,7 +83,9 @@ assert_integer_or_nil(fs1.rdev_minor) assert_integer(fs1.ino) assert_integer(fs1.mode) - unless /emx/ =~ RUBY_PLATFORM + unless /emx|mswin|mingw/ =~ RUBY_PLATFORM + # on Windows, nlink is always 1. but this behavior will be changed + # in the future. assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink) end assert_integer(fs1.uid) @@ -393,8 +395,10 @@ assert_equal(@file, File.expand_path(@file + "::$DATA")) end assert_kind_of(String, File.expand_path("~")) - assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") } - assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") } + unless /mingw|mswin/ =~ RUBY_PLATFORM + assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") } + assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") } + end assert_incompatible_encoding {|d| File.expand_path(d)} end @@ -574,7 +578,9 @@ assert_integer_or_nil(fs1.rdev_minor) assert_integer(fs1.ino) assert_integer(fs1.mode) - unless /emx/ =~ RUBY_PLATFORM + unless /emx|mswin|mingw/ =~ RUBY_PLATFORM + # on Windows, nlink is always 1. but this behavior will be changed + # in the future. assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink) end assert_integer(fs1.uid) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/