Skip to content

Commit

Permalink
test: add markdown format code test
Browse files Browse the repository at this point in the history
  • Loading branch information
matty-rose committed Oct 24, 2021
1 parent 3ff5f77 commit bdef72c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/document/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,29 @@ func TestCreateMarkdownLink(t *testing.T) {
assert.Equal(t, tc.expectedLink, document.NewMarkdownDocument().CreateLink(tc.title, tc.url))
}
}

func TestMarkdownFormatCode(t *testing.T) {
t.Parallel()

testCases := []struct {
text string
expectedCode string
}{
{
"",
"",
},
{
"title",
"`title`",
},
{
"a longer title",
"`a longer title`",
},
}

for _, tc := range testCases {
assert.Equal(t, tc.expectedCode, document.NewMarkdownDocument().FormatCode(tc.text))
}
}

0 comments on commit bdef72c

Please sign in to comment.