12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package main
- import (
- "testing"
- )
- func TestCleanupForInclude(t *testing.T) {
- var tests = []struct {
- markdown, expectedMarkdown string
- }{
- {
-
-
- markdown: "line 1\n" +
- "line 2\n" +
- "line 3",
- expectedMarkdown: "line 2\n" +
- "line 3",
- },
- {
-
- markdown: "line 1\n" +
- "line 2\n" +
- "### SEE ALSO\n" +
- "line 3",
- expectedMarkdown: "line 2\n",
- },
- }
- for _, rt := range tests {
- actual := cleanupForInclude(rt.markdown)
- if actual != rt.expectedMarkdown {
- t.Errorf(
- "failed cleanupForInclude:\n\texpected: %s\n\t actual: %s",
- rt.expectedMarkdown,
- actual,
- )
- }
- }
- }
|