Documentation ¶
Index ¶
- func AssertEqualBytes(t *testing.T, a, b []byte) bool
- func AssertSameStructure(t *testing.T, sourceA, sourceB []byte, a, b ast.Node, ...) bool
- func DoTestCase(m goldmark.Markdown, testCase MarkdownTestCase, t TestingT)
- func DoTestCaseFile(m goldmark.Markdown, filename string, t TestingT)
- func DoTestCases(m goldmark.Markdown, cases []MarkdownTestCase, t TestingT)
- type AssertNodeFunc
- type MarkdownTestCase
- type NodeAssertions
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqualBytes ¶
AssertEqualBytes asserts that the two input byte slices have the same length and contents.
func AssertSameStructure ¶
func AssertSameStructure(t *testing.T, sourceA, sourceB []byte, a, b ast.Node, assertions NodeAssertions) bool
AssertSameStructure walks the ASTs rooted at a and b
func DoTestCase ¶
func DoTestCase(m goldmark.Markdown, testCase MarkdownTestCase, t TestingT)
DoTestCase runs a test case.
func DoTestCaseFile ¶
DoTestCaseFile runs test cases in a given file.
func DoTestCases ¶
func DoTestCases(m goldmark.Markdown, cases []MarkdownTestCase, t TestingT)
DoTestCases runs a set of test cases.
Types ¶
type AssertNodeFunc ¶
AssertNodeFunc is used by AssertSameStructure to assert that two nodes are semantically identical.
type MarkdownTestCase ¶
MarkdownTestCase represents a test case.
type NodeAssertions ¶
type NodeAssertions map[ast.NodeKind]AssertNodeFunc
NodeAssertions maps from node kinds to AssertNodeFunc.
func DefaultNodeAssertions ¶
func DefaultNodeAssertions() NodeAssertions
DefaultNodeAssertions returns the default set of node assertions.
func (NodeAssertions) Union ¶
func (na NodeAssertions) Union(other NodeAssertions) NodeAssertions
Union returns a new set of node assertions that is the union of the two input sets.
Click to show internal directories.
Click to hide internal directories.