8000 Merge branch 'master' into ruby2 · rubychan/coderay-scanner-tests@8184d70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8184d70

Browse files
committed
Merge branch 'master' into ruby2
2 parents c4b5894 + 7e6d9ef commit 8184d70

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

coderay_suite.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ def examples_test scanner, max
253253

254254
if total_time_for_scanning > 0 && total_time_for_direct_streaming > 0
255255
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
260260
puts
261261
end
262262
end
@@ -372,13 +372,15 @@ def complete_test scanner, code, name
372372
print "\b" * 'scanning...'.size
373373
print 'encoding...'.yellow
374374
@time_for_encoding = Benchmark.realtime do
375-
DebugLintTokenizer.encode_tokens tokens
375+
BenchmarkHighlighter.encode_tokens tokens
376376
end
377377
print "\b" * 'encoding...'.size
378378

379+
result = DebugLintTokenizer.encode code, scanner.lang
380+
379381
print 'benchmarking...'.magenta
380382
@time_for_direct_streaming = Benchmark.realtime do
381-
result = DebugLintTokenizer.encode code, scanner.lang
383+
BenchmarkHighlighter.encode code, scanner.lang
382384
end
383385
print "\b" * 'benchmarking...'.size
384386
print ' ' * 'benchmarking...'.size
@@ -470,13 +472,16 @@ def identity_test scanner, tokens
470472
end
471473

472474
Highlighter = CodeRay::Encoders[:html].new(
473-
:tab_width => 8,
474475
:line_numbers => :table,
475476
:wrap => :page,
476477
:hint => :debug,
477478
:css => :class
478479
)
479480

481+
BenchmarkHighlighter = CodeRay::Encoders[:div].new(
482+
:line_numbers => :table
483+
)
484+
480485
def highlight_test tokens, name, okay, changed_lines
481486
actual_html = name + '.actual.html'
482487
title = "Testing #{self.class.name[/\w+$/]}: #{name}"

0 commit comments

Comments
 (0)
0