present: add end-to-end rendering test
See testdata/README for test format.
This will make it easier to fix problems and not regress.
Markdown tests in followup CL (with bug fixes).
Change-Id: I5dedca26d3c29fd428066ffb38c6605343784a19
Reviewed-on: https://go-review.googlesource.com/c/tools/+/224957
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
diff --git a/present/testdata/code.p b/present/testdata/code.p
new file mode 100644
index 0000000..900e2ae
--- /dev/null
+++ b/present/testdata/code.p
@@ -0,0 +1,39 @@
+Code
+
+*
+
+Code:
+
+.code testdata/code.txt
+
+Snippet:
+
+.code testdata/code.txt /Snippet/
+
+Highlight:
+
+.code testdata/code.txt HL1
+
+---
+<h1>Code</h1>
+<section>
+<p>Code:</p>
+<div class="code">
+<pre><span num="1">code file</span>
+<span num="2">Snippet</span>
+<span num="3">important</span>
+</pre>
+</div>
+<p>Snippet:</p>
+<div class="code">
+<pre><span num="2">Snippet</span>
+</pre>
+</div>
+<p>Highlight:</p>
+<div class="code">
+<pre><span num="1">code file</span>
+<span num="2">Snippet</span>
+<span num="3"><b>important</b></span>
+</pre>
+</div>
+</section>