X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/0bc8db71aa5d2c55b215a7a15b073bb85a1172eb..f4509310b5abe5012cb83bed3960404e8fa92217:/terminal_markdown_test.go?ds=sidebyside diff --git a/terminal_markdown_test.go b/terminal_markdown_test.go index adf0fa4..0eb3222 100644 --- a/terminal_markdown_test.go +++ b/terminal_markdown_test.go @@ -16,13 +16,13 @@ func TestTerminalMarkdownBlocksAndMarks(t *testing.T) { want []string }{ { - name: "headings and a full width rule", + name: "renders headings and fills the rule width", text: "# First\n###### Last ###\n---", columns: 12, want: []string{"\x1b[1mFirst\x1b[0m", "\x1b[1mLast\x1b[0m", "\x1b[2m------------\x1b[0m"}, }, { - name: "bold italic and code", + name: "renders bold italic and inline code styles", text: "**bold** __also__ *lean* _also_ `code`", columns: 80, want: []string{"\x1b[1mbold\x1b[0m \x1b[1malso\x1b[0m \x1b[3mlean\x1b[0m \x1b[3malso\x1b[0m \x1b[7mcode\x1b[0m"}, @@ -88,6 +88,7 @@ func TestTerminalMarkdownBlocksAndMarks(t *testing.T) { want: []string{"safe[31m end"}, }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { require.Equal(t, tc.want, terminalMarkdown(tc.text, tc.columns)) @@ -145,6 +146,7 @@ func TestTerminalMarkdownNarrowLinesKeepQuoteAndListMarks(t *testing.T) { want: []string{"| a", "| b"}, }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { require.Equal(t, tc.want, terminalMarkdown(tc.text, tc.columns))