blob: 50ff23a98e6e7f310460574c917327a572f5e820 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package markdown
import "testing"
func TestQuote(t *testing.T) {
content := `
> Bonsoir, je suis un **code**
avec une source
`
lxs := lex(content, new(Option))
tree, err := ast(lxs)
if err != nil {
t.Fatal(err)
}
c, err := tree.Eval(nil)
if err != nil {
t.Fatal(err)
}
if c != `<div class="quote"><blockquote>Bonsoir, je suis un <b>code</b></blockquote><p>avec une source</p></div>` {
t.Errorf("failed, got %s", c)
t.Logf("lxs: %s\ntree: %s", lxs, tree)
}
}
|