From 07f04f468d729b399b794198c61516f2e8ac0a89 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 26 Oct 2017 07:36:23 +0000 Subject: test_env.rb: fix one-off bug * test/ruby/test_env.rb (TestEnv#test_win32_blocksize): count the terminator byte too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_env.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index d136ba75fa..0ed88dd1d5 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -429,7 +429,7 @@ class TestEnv < Test::Unit::TestCase if /mswin|mingw/ =~ RUBY_PLATFORM def test_win32_blocksize keys = [] - len = 32767 - ENV.to_a.flatten.inject(0) {|r,e| r + e.bytesize + 1} + len = 32767 - ENV.to_a.flatten.inject(1) {|r,e| r + e.bytesize + 1} val = "bar" * 1000 key = nil while (len -= val.size + (key="foo#{len}").size + 2) > 0 -- cgit v1.2.3