diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-11 07:47:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-11 07:47:44 +0000 |
commit | da47bbd1db646794fba94449d4d226d35ec2b2ff (patch) | |
tree | 4438039d7593722c3312dbe5bbf347d6b6d82a08 /test/ruby/test_require.rb | |
parent | 073e6ccc7ba29e1391865107f105b8069352ee52 (diff) | |
download | ruby-da47bbd1db646794fba94449d4d226d35ec2b2ff.tar.gz |
* hash.c (ruby_setenv): raise if putenv and SetEnvironmentVariable
failed, because of the restriction of the size on Windows.
based on a patch from Peter Weldon at [ruby-core:32304]. fix:
Bug#3812, [ruby-core:32250]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_require.rb')
-rw-r--r-- | test/ruby/test_require.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index f87de90ab9..aef7f7b527 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -29,7 +29,7 @@ class TestRequire < Test::Unit::TestCase INPUT begin - assert_in_out_err(["-S", "foo/" * 10000 + "foo"], "") do |r, e| + assert_in_out_err(["-S", "foo/" * 2500 + "foo"], "") do |r, e| assert_equal([], r) assert_operator(2, :<=, e.size) assert_equal("openpath: pathname too long (ignored)", e.first) @@ -48,19 +48,24 @@ class TestRequire < Test::Unit::TestCase def test_require_path_home env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"] + pathname_too_long = /pathname too long \(ignored\).*\(LoadError\)/m ENV["RUBYPATH"] = "~" - ENV["HOME"] = "/foo" * 10000 - assert_in_out_err(%w(-S test_ruby_test_require), "", [], /^.+$/) + ENV["HOME"] = "/foo" * 2500 + assert_in_out_err(%w(-S test_ruby_test_require), "", [], pathname_too_long) - ENV["RUBYPATH"] = "~" + "/foo" * 10000 + ENV["RUBYPATH"] = "~" + "/foo" * 2500 ENV["HOME"] = "/foo" - assert_in_out_err(%w(-S test_ruby_test_require), "", [], /^.+$/) + assert_in_out_err(%w(-S test_ruby_test_require), "", [], pathname_too_long) t = Tempfile.new(["test_ruby_test_require", ".rb"]) t.puts "p :ok" t.close + ENV["RUBYPATH"] = "~" + ENV["HOME"] = t.path + assert_in_out_err(%w(-S test_ruby_test_require), "", [], /\(LoadError\)/) + ENV["HOME"], name = File.split(t.path) assert_in_out_err(["-S", name], "", %w(:ok), []) |