blob: b116544109d3c318ed2e3cfb44c69a858e08a563 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package markdown
import "testing"
func TestCode(t *testing.T) {
got, err := Parse("`mono`", nil)
if err != nil {
t.Fatal(err)
}
if string(got) != `<p><code>mono</code></p>` {
t.Errorf("invalid value, got %s", got)
}
got, err = Parse("bonjour `code` !", nil)
if err != nil {
t.Fatal(err)
}
if string(got) != `<p>bonjour <code>code</code> !</p>` {
t.Errorf("invalid value, got %s", got)
}
got, err = Parse(
"```\n"+"raw\nhehe"+"```",
nil,
)
if err != nil {
t.Fatal(err)
}
if string(got) != `<pre><code>raw
hehe</code></pre>` {
t.Errorf("invalid value, got %s", got)
}
}
|