Merge pull request #60 from mmarkdown/whitespacehack

Mark tests: remove whitespace hack
This commit is contained in:
Miek Gieben 2018-08-15 15:21:49 +01:00 committed by GitHub
commit 55ca3c7e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -31,12 +31,6 @@ func TestMmark(t *testing.T) {
got := ToHTML([]byte(input), p, nil) got := ToHTML([]byte(input), p, nil)
// make whitespace more visible
got = bytes.Replace(got, []byte(" "), []byte("_"), -1)
want = bytes.Replace(want, []byte(" "), []byte("_"), -1)
got = bytes.Replace(got, []byte("\n"), []byte("_\n"), -1)
want = bytes.Replace(want, []byte("\n"), []byte("_\n"), -1)
if bytes.Compare(got, want) != 0 { if bytes.Compare(got, want) != 0 {
t.Errorf("want (%d bytes) %s, got (%d bytes) %s, for input %q", len(want), want, len(got), got, input) t.Errorf("want (%d bytes) %s, got (%d bytes) %s, for input %q", len(want), want, len(got), got, input)
} }

6
testdata/mmark.test vendored
View File

@ -24,9 +24,9 @@ println("hi")
Caption: This *is* a Caption: This *is* a
caption. caption.
--- ---
<h1>Test_Code_Captions</h1> <h1>Test Code Captions</h1>
<figure> <figure>
<pre><code_class="language-go">println(&quot;hi&quot;) <pre><code class="language-go">println(&quot;hi&quot;)
</code></pre> </code></pre>
<figcaption>This <em>is</em> a <figcaption>This <em>is</em> a
caption.</figcaption> caption.</figcaption>
@ -54,7 +54,7 @@ Caption: Shakespeare.
# Test Citations # Test Citations
[@RFC1034] [@RFC1034]
--- ---
<h1>Test_Citations</h1> <h1>Test Citations</h1>
<p><cite class="informative">[RFC1034]</cite></p> <p><cite class="informative">[RFC1034]</cite></p>
--- ---