diff options
Diffstat (limited to 'markdown/ast_code_test.go')
| -rw-r--r-- | markdown/ast_code_test.go | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/markdown/ast_code_test.go b/markdown/ast_code_test.go index b116544..f9c57f3 100644 --- a/markdown/ast_code_test.go +++ b/markdown/ast_code_test.go @@ -3,31 +3,10 @@ package markdown import "testing" func TestCode(t *testing.T) { - got, err := Parse("`mono`", nil) - if err != nil { - t.Fatal(err) - } - if string(got) != `<p><code>mono</code></p>` { - t.Errorf("invalid value, got %s", got) - } - - got, err = Parse("bonjour `code` !", nil) - if err != nil { - t.Fatal(err) - } - if string(got) != `<p>bonjour <code>code</code> !</p>` { - t.Errorf("invalid value, got %s", got) - } - - got, err = Parse( - "```\n"+"raw\nhehe"+"```", - nil, - ) - if err != nil { - t.Fatal(err) - } - if string(got) != `<pre><code>raw -hehe</code></pre>` { - t.Errorf("invalid value, got %s", got) - } + t.Run("code", func(t *testing.T) { + t.Run("mono", test("`mono`", `<p><code>mono</code></p>`)) + t.Run("combo", test("bonjour `code` !", `<p>bonjour <code>code</code> !</p>`)) + t.Run("mult-line", test("```\n"+"raw\nhehe"+"```", `<pre><code>raw +hehe</code></pre>`)) + }) } |
