Documentation
¶
Overview ¶
Package testutil provides utilities for unit tests.
Index ¶
- func DiffPretty[T1 []byte | string, T2 []byte | string](v1 T1, v2 T2) []byte
- func DoTestCase(m MarkdownToStringFunc, testCase MarkdownTestCase, t TestingT)
- func DoTestCaseFile(m MarkdownToStringFunc, filename string, t TestingT, no ...int)
- func DoTestCases(m MarkdownToStringFunc, cases []MarkdownTestCase, t TestingT)
- func ParseCliCaseArg() []int
- type MarkdownTestCase
- type MarkdownTestCaseOptions
- type MarkdownToStringFunc
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffPretty ¶
DiffPretty returns pretty formatted diff between given bytes.
func DoTestCase ¶
func DoTestCase(m MarkdownToStringFunc, testCase MarkdownTestCase, t TestingT)
DoTestCase runs a test case.
func DoTestCaseFile ¶
func DoTestCaseFile(m MarkdownToStringFunc, filename string, t TestingT, no ...int)
DoTestCaseFile runs test cases in a given file.
func DoTestCases ¶
func DoTestCases(m MarkdownToStringFunc, cases []MarkdownTestCase, t TestingT)
DoTestCases runs a set of test cases.
Types ¶
type MarkdownTestCase ¶
type MarkdownTestCase struct {
No int
Description string
Options MarkdownTestCaseOptions
Markdown string
Expected string
}
MarkdownTestCase represents a test case.
type MarkdownTestCaseOptions ¶
MarkdownTestCaseOptions represents options for each test case.
type MarkdownToStringFunc ¶
MarkdownToStringFunc is a function type that converts markdown to HTML.
func NewMarkdownToStringFunc ¶
NewMarkdownToStringFunc returns a MarkdownToStringFunc that uses the given parser and renderer.
Click to show internal directories.
Click to hide internal directories.