diff options
| author | KaĆque Kandy Koga <kaiquekandykoga@gmail.com> | 2022-08-08 14:53:05 -0300 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-11-08 11:32:30 +0900 |
| commit | 9523f53465bff9e77dfeba82526112e2de91bdb4 (patch) | |
| tree | aac728be91e6f7be1085d47470808ed02a166968 /test | |
| parent | b56b70a373753fd5c6d1b6df911342c8d0138695 (diff) | |
[ruby/benchmark] Adjust ljust Benchmark#bm with labels was not using the highest length among the labels to adjust the correct ljust. Instead of printing the result during the report generation, now it is waiting to print the result once it is generated.
Benchmark.bm { |x|
x.item("aaaa") { 1 }
x.item("aaaaaaaa") { 0 }
}
After
user system total real
aaaa 0.000005 0.000002 0.000007 ( 0.000003)
aaaaaaaa 0.000001 0.000001 0.000002 ( 0.000002)
Before
user system total real
aaaa 0.000005 0.000001 0.000006 ( 0.000003)
aaaaaaaa 0.000002 0.000001 0.000003 ( 0.000003)
https://github.com/ruby/benchmark/commit/3e74533ead
Diffstat (limited to 'test')
| -rw-r--r-- | test/benchmark/test_benchmark.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/benchmark/test_benchmark.rb b/test/benchmark/test_benchmark.rb index ddd4a591bb..2e0c47af75 100644 --- a/test/benchmark/test_benchmark.rb +++ b/test/benchmark/test_benchmark.rb @@ -65,9 +65,9 @@ BENCH def test_benchmark_does_not_print_any_space_if_the_given_caption_is_empty assert_equal(<<-BENCH, capture_bench_output(:benchmark)) -first --time-- --time-- --time-- ( --time--) +first --time-- --time-- --time-- ( --time--) second --time-- --time-- --time-- ( --time--) -third --time-- --time-- --time-- ( --time--) +third --time-- --time-- --time-- ( --time--) BENCH end |
