adds test/spec

This commit is contained in:
Rasmus Andersson 2020-10-15 13:53:03 -07:00
parent 7ce2301dad
commit 96d9547723
3 changed files with 9735 additions and 1 deletions

28
test/spec/spec.js Normal file
View file

@ -0,0 +1,28 @@
const fs = require("fs")
const markdown = require('../../dist/markdown.node.js')
const { exit } = require("../testutil")
// https://spec.commonmark.org
const source = fs.readFileSync(__dirname + "/spec.md")
const timeLabel = `markdown.parse("spec.md")`
console.time(timeLabel)
let html = markdown.parse(source)
console.timeEnd(timeLabel)
html = `
<html lang="en">
<head>
<meta charset="utf-8">
<title>Markdown spec</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
${html}
</body>
</html>
`.trim()
const outfile = __dirname + "/spec.html"
fs.writeFileSync(outfile, html, "utf8")
exit()

9702
test/spec/spec.md Executable file

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,10 @@
set -euo pipefail
cd "$(dirname "$0")"
node spec/spec.js &
for f in issue*.js; do
node "$f" "$@"
node "$f" "$@" &
done
wait