aboutsummaryrefslogtreecommitdiff
path: root/markdown/ast_modifier_test.go
blob: 8ccc860ea174e52a91e2611bc9bc8b043413f07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package markdown

import "testing"

func TestModifier(t *testing.T) {
	content := `
**bo*n*soir**, ça ***va* bien** ?
`
	lxs := lex(content)
	tree, err := ast(lxs)
	if err != nil {
		t.Fatal(err)
	}
	c, err := tree.Eval(nil)
	if err != nil {
		t.Fatal(err)
	}
	if c != "<p><b>bo<em>n</em>soir</b>, ça <b><em>va</em> bien</b> ?</p>" {
		t.Errorf("failed, got %s", c)
		t.Logf("lxs: %s\ntree: %s", lxs, tree)
	}
}