[前][次][番号順一覧][スレッド一覧]

ruby-changes:48325

From: nobu <ko1@a...>
Date: Thu, 26 Oct 2017 16:36:28 +0900 (JST)
Subject: [ruby-changes:48325] nobu:r60439 (trunk): test_env.rb: fix one-off bug

nobu	2017-10-26 16:36:23 +0900 (Thu, 26 Oct 2017)

  New Revision: 60439

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60439

  Log:
    test_env.rb: fix one-off bug
    
    * test/ruby/test_env.rb (TestEnv#test_win32_blocksize): count the
      terminator byte too.

  Modified files:
    trunk/test/ruby/test_env.rb
Index: test/ruby/test_env.rb
===================================================================
--- test/ruby/test_env.rb	(revision 60438)
+++ test/ruby/test_env.rb	(revision 60439)
@@ -429,7 +429,7 @@ class TestEnv < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_env.rb#L429
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]