assert

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package assert provides a set of functions to help with testing of this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, expected, got any)

func Error

func Error(t *testing.T, err error)

func False

func False(t *testing.T, got bool)

func Nil

func Nil(t *testing.T, got any)

func NoError

func NoError(t *testing.T, err error)

func NotEqual

func NotEqual(t *testing.T, expected, got any)

func NotNil

func NotNil(t *testing.T, got any)

func Render added in v0.2.0

func Render(t *testing.T, expected string, node Node)

Render renders a NodX node with all the Render methods and asserts that the output is equal to the expected string.

func RenderNoSpaces added in v0.2.0

func RenderNoSpaces(t *testing.T, expected string, node Node)

RenderNoSpaces is the same as Render, but it removes all the white spaces and similar characters from the expected and the output to make the test more readable without the need to remove spaces manually when writing the test.

func True

func True(t *testing.T, got bool)

Types

type Node added in v0.2.0

type Node interface {
	Render(w io.Writer) error
	RenderString() (string, error)
	RenderBytes() ([]byte, error)
	String() string
}

Node with basic Render methods.

Redeclared to avoid import cycle.

Jump to

Keyboard shortcuts

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