aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_test.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 21:29:07 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 21:29:07 +0200
commitc4ba44b1c3e066f98ccc406c15a8c1de170e4709 (patch)
treeb4974a5acdf11c0aaddb0d5d9526bfa62e35b9c9 /mardown/ast_test.go
parent3d3ccdec245b5a5d1c1f01d0b6972959332c882e (diff)
fix(markdown): bad condition in finished lexer and missing return value in ast
Diffstat (limited to 'mardown/ast_test.go')
-rw-r--r--mardown/ast_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/mardown/ast_test.go b/mardown/ast_test.go
new file mode 100644
index 0000000..11a9639
--- /dev/null
+++ b/mardown/ast_test.go
@@ -0,0 +1,20 @@
+package mardown
+
+import "testing"
+
+func TestAst(t *testing.T) {
+ content := "bonsoir"
+ 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 != "<p>bonsoir</p>" {
+ t.Errorf("failed, got %s", c)
+ t.Logf("lxs: %s\ntree: %s", lxs, tree)
+ }
+}