diff options
author | arton <arton@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-19 09:28:49 +0000 |
---|---|---|
committer | arton <arton@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-19 09:28:49 +0000 |
commit | 5281610f919f96fd0ec1a14a53ad42b54bc8d373 (patch) | |
tree | 4bd6221f808183d188c26a952c81f25c92223a4b /test/ruby/test_env.rb | |
parent | 812550b977e2114d74212ee211e520baee8760f3 (diff) | |
download | ruby-5281610f919f96fd0ec1a14a53ad42b54bc8d373.tar.gz |
* hash.c (ruby_setenv): calculate total env block size for win32.
* test/ruby/test_env.rb: add test for above patch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_env.rb')
-rw-r--r-- | test/ruby/test_env.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index 681b21d614..b987a4bac0 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -387,4 +387,16 @@ class TestEnv < Test::Unit::TestCase assert_equal(huge_value, ENV["foo"]) end end + + if /mswin|mingw/ =~ RUBY_PLATFORM + def test_win32_blocksize + len = 32767 - ENV.to_a.flatten.inject(0) {|r,e| r + e.size + 2 } + val = "bar" * 1000 + key = nil + 1.upto(12) {|i| + ENV[key] = val while (len -= val.size + (key="foo#{len}").size + 2) > 0 + assert_raise(Errno::EINVAL) { ENV[key] = val } + } + end + end end |