Documentation
¶
Overview ¶
Package htmltest provides a set of tools for testing rendered HTML page elements.
Index ¶
- Variables
- func IsLocalURL(s string) bool
- func IsPadding(n *html.Node) bool
- func JoinURL(base, path string) (string, error)
- func NewMatchError(path []string, cause error) error
- func ParseAttributes(node *html.Node) (map[string]string, error)
- func ParseCommaSeparatedKeyedValues(s string) (map[string]string, error)
- func ParseTextContent(node *html.Node) string
- func Path(node *html.Node) string
- type MatchError
- type Middleware
- type MiddlewareFunc
- type Node
- type Validator
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDuplicateValue = errors.New("duplicate value")
)
Functions ¶
func IsLocalURL ¶ added in v0.0.3
func NewMatchError ¶
func ParseTextContent ¶
Types ¶
type MatchError ¶
func (MatchError) Error ¶
func (e MatchError) Error() string
func (MatchError) Unwrap ¶
func (e MatchError) Unwrap() error
type Middleware ¶ added in v0.0.3
var SkipMiddleware Middleware = skipSingleton
SkipMiddleware is a middleware that does nothing.
func NewDeduplicator ¶ added in v0.0.3
func NewDeduplicator(nameSpace string) Middleware
type MiddlewareFunc ¶ added in v0.0.3
func (MiddlewareFunc) Wrap ¶ added in v0.0.3
func (f MiddlewareFunc) Wrap(v Validator) Validator
type Validator ¶
var SkipValidator Validator = skipSingleton
SkipValidator is a validator that never returns an error. It is a sentinel value used to skip validation tests and reduce the verbosity of test output.
func NewExactMatch ¶
NewExactMatch creates a validator that checks if the input string matches the expected string.
type ValidatorFunc ¶
func (ValidatorFunc) Validate ¶
func (f ValidatorFunc) Validate(s string) error
Click to show internal directories.
Click to hide internal directories.