@@ -253,10 +253,10 @@ def examples_test scanner, max
253
253
254
254
if total_time_for_scanning > 0 && total_time_for_direct_streaming > 0
255
255
print "Average speed for #{ scanner . class . title } scanner: " . green
256
- print '%0.0f' . yellow % [ total_filesize / total_time_for_scanning / 1000 ]
257
- print ' kB/s scanning / ' . white
258
- print '%0.0f' . magenta % [ total_filesize / total_time_for_direct_streaming / 1000 ]
259
- print ' kB/s highlighting.' . white
256
+ print '%0.0f kB/s ' . yellow % [ total_filesize / total_time_for_scanning / 1000 ]
257
+ print ' scanning / ' . white
258
+ print '%0.0f kB/s ' . magenta % [ total_filesize / total_time_for_direct_streaming / 1000 ]
259
+ print ' highlighting to HTML page .' . white
260
260
puts
261
261
end
262
262
end
@@ -372,13 +372,15 @@ def complete_test scanner, code, name
372
372
print "\b " * 'scanning...' . size
373
373
print 'encoding...' . yellow
374
374
@time_for_encoding = Benchmark . realtime do
375
- DebugLintTokenizer . encode_tokens tokens
375
+ BenchmarkHighlighter . encode_tokens tokens
376
376
end
377
377
print "\b " * 'encoding...' . size
378
378
379
+ result = DebugLintTokenizer . encode code , scanner . lang
380
+
379
381
print 'benchmarking...' . magenta
380
382
@time_for_direct_streaming = Benchmark . realtime do
381
- result = DebugLintTokenizer . encode code , scanner . lang
383
+ BenchmarkHighlighter . encode code , scanner . lang
382
384
end
383
385
print "\b " * 'benchmarking...' . size
384
386
print ' ' * 'benchmarking...' . size
@@ -470,13 +472,16 @@ def identity_test scanner, tokens
470
472
end
471
473
472
474
Highlighter = CodeRay ::Encoders [ :html ] . new (
473
- :tab_width => 8 ,
474
475
:line_numbers => :table ,
475
476
:wrap => :page ,
476
477
:hint => :debug ,
477
478
:css => :class
478
479
)
479
480
481
+ BenchmarkHighlighter = CodeRay ::Encoders [ :div ] . new (
482
+ :line_numbers => :table
483
+ )
484
+
480
485
def highlight_test tokens , name , okay , changed_lines
481
486
actual_html = name + '.actual.html'
482
487
title = "Testing #{ self . class . name [ /\w +$/ ] } : #{ name } "
0 commit comments