зеркало из https://github.com/github/ruby.git
* lib/benchmark.rb (Benchmark::Tms#add): fix NameError.
[ruby-dev:40906] * test/benchmark/test_benchmark.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
eb86567b69
Коммит
fe0aab0911
|
@ -1,3 +1,10 @@
|
|||
Sat Apr 3 03:19:01 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||
|
||||
* lib/benchmark.rb (Benchmark::Tms#add): fix NameError.
|
||||
[ruby-dev:40906]
|
||||
|
||||
* test/benchmark/test_benchmark.rb: add a test for above.
|
||||
|
||||
Sat Apr 3 01:50:02 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/rdoc/parser/ruby.rb (RDoc#make_message): no empty lines.
|
||||
|
|
|
@ -440,7 +440,7 @@ module Benchmark
|
|||
#
|
||||
# An in-place version of #add.
|
||||
#
|
||||
def add!
|
||||
def add!(&blk)
|
||||
t = Benchmark::measure(&blk)
|
||||
@utime = utime + t.utime
|
||||
@stime = stime + t.stime
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
require "test/unit"
|
||||
require "benchmark"
|
||||
|
||||
class TestBenchmark < Test::Unit::TestCase
|
||||
def test_add!
|
||||
assert_nothing_raised("[ruby-dev:40906]") do
|
||||
Benchmark::Tms.new.add! {}
|
||||
end
|
||||
end
|
||||
end
|
Загрузка…
Ссылка в новой задаче