aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_quote_test.go
blob: c3c7b3bbcf47f795d9cfebfbdf2cce3382dac052 (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 mardown

import "testing"

func TestQuote(t *testing.T) {
	content := `
> Bonsoir, je suis un **code**
avec une source
`
	lxs := lex(content)
	tree, err := ast(lxs)
	if err != nil {
		t.Fatal(err)
	}
	c, err := tree.Eval()
	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)
	}
}