Navigation Menu

Skip to content

Commit

Permalink
Fix over width progress
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 11, 2012
1 parent c79a3a1 commit 64a6906
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/groonga/tester.rb
Expand Up @@ -1535,10 +1535,15 @@ def draw_progress_line
progress_width -= start_mark.bytesize
progress_width -= finish_mark.bytesize
progress_width -= statistics.bytesize
finished_mark = "="
if n_done_tests == @n_tests
progress = "=" * progress_width
progress = finished_mark * progress_width
else
progress = "=" * (progress_width * finished_test_ratio).ceil + ">"
current_mark = ">"
finished_marks_width = (progress_width * finished_test_ratio).ceil
finished_marks_width -= current_mark.bytesize
finished_marks_width = [0, finished_marks_width].max
progress = finished_mark * finished_marks_width + current_mark
progress = progress.ljust(progress_width)
end
puts("#{start_mark}#{progress}#{finish_mark}#{statistics}")
Expand Down

0 comments on commit 64a6906

Please sign in to comment.