When I use apostrophe character in benchmark's name, all the charts in the html report are broken.
Steps to reproduce
- use apostrophe in benchmark's name:
module Main where
import Criterion
import Criterion.Main
main :: IO ()
main = defaultMain
[ env (return ()) $
\ ~() -> bgroup "Jan's benchmarks" [bench "dummy" $ nf id ()]
]
- compile the file and run it, enabling html report generation:
./mybench --output report.html
- Open the resulting report in the browser (I use latest google-chrom version 69)
Actual result:
none of the charts is displayed, and browser's console shows this error
Uncaught SyntaxError: Unexpected identifier
Inspecting the report more closely the error is coming from this piece of code generated in the report based on benchmark's name:
var ylabels = [[-0,'<a href="#b0">Jan's benchmarks/dummy</a>'],];
Literal inclusion of benchmark's name into the javascript apparently leads to premature finish of the string literal, causing the sytax error.
When I use apostrophe character in benchmark's name, all the charts in the html report are broken.
Steps to reproduce
./mybench --output report.html
Actual result:
none of the charts is displayed, and browser's console shows this error
Uncaught SyntaxError: Unexpected identifierInspecting the report more closely the error is coming from this piece of code generated in the report based on benchmark's name:
Literal inclusion of benchmark's name into the javascript apparently leads to premature finish of the string literal, causing the sytax error.