From 73c4a664b03f8afa8edb527fb6a8cc310bdb3380 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sat, 20 Dec 2025 18:24:09 +0100 Subject: test(markdown): use subtest to clean --- markdown/ast_quote_test.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'markdown/ast_quote_test.go') diff --git a/markdown/ast_quote_test.go b/markdown/ast_quote_test.go index 50ff23a..203d4fc 100644 --- a/markdown/ast_quote_test.go +++ b/markdown/ast_quote_test.go @@ -3,21 +3,13 @@ package markdown import "testing" func TestQuote(t *testing.T) { - content := ` + t.Run("quote", func(t *testing.T) { + t.Run("simple", test(` +> Bonsoir +`, `
Bonsoir
`)) + t.Run("source", test(` > 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 != `
Bonsoir, je suis un code

avec une source

` { - t.Errorf("failed, got %s", c) - t.Logf("lxs: %s\ntree: %s", lxs, tree) - } +`, `
Bonsoir, je suis un code

avec une source

`)) + }) } -- cgit v1.2.3