tester

package
v2.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectRepresentation

func ExpectRepresentation(t *testing.T, doc *html.Node, name string, expectedHtml string)

func GoldenFiles

func GoldenFiles(t *testing.T, convert ConvertFunc, roundTripConvert ConvertFunc)

func Parse

func Parse(t *testing.T, rawHTML string, startFrom string) *html.Node

Types

type ConvertFunc

type ConvertFunc func(html []byte) (markdown []byte, err error)

type Result

type Result struct {
	Identifier string

	FirstDuration  time.Duration
	SecondDuration time.Duration

	OriginalHtml     []byte
	FirstMarkdown    []byte
	IntermediateHtml []byte
	SecondMarkdown   []byte
}

func RoundTrip

func RoundTrip(identifier string, originalHtml []byte, convert ConvertFunc) (*Result, error)

func (Result) GetStatus

func (r Result) GetStatus() string

func (Result) PrintStatus

func (r Result) PrintStatus()

func (Result) WriteToFiles

func (r Result) WriteToFiles(folderpath string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL