From 94dceb4f7c1740de9215b36ec183f93ca4337ee7 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 2 Oct 2025 19:52:38 +0200 Subject: style(markdown): fix typo in package name --- markdown/ast_list_test.go | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 markdown/ast_list_test.go (limited to 'markdown/ast_list_test.go') diff --git a/markdown/ast_list_test.go b/markdown/ast_list_test.go new file mode 100644 index 0000000..2819814 --- /dev/null +++ b/markdown/ast_list_test.go @@ -0,0 +1,44 @@ +package markdown + +import ( + "strings" + "testing" +) + +var rw = ` +- item A +- item B +* item C + +1. item 1 +2. item 2 +` + +var expected = ` + +
    +
  1. item 1
  2. +
  3. item 2
  4. +
+` + +func TestList(t *testing.T) { + lxs := lex(rw) + tree, err := ast(lxs) + if err != nil { + t.Fatal(err) + } + got, err := tree.Eval() + if err != nil { + t.Fatal(err) + } + exp := strings.ReplaceAll(expected, "\n", "") + if string(got) != exp { + t.Errorf("invalid value, got %s", got) + t.Logf("expected %s", exp) + } +} -- cgit v1.2.3