test

package
v0.0.0-...-40a6ac2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package test implements unit test feature.

Index

Constants

This section is empty.

Variables

View Source
var (
	BPDFFile = ".bpdf.yml"
)

Functions

This section is empty.

Types

type BPDFTest

type BPDFTest struct {
	// contains filtered or unexported fields
}

BPDFTest is the unit test instance.

func New

func New(t *testing.T) *BPDFTest

New creates the BPDFTest instance to unit tests.

func (*BPDFTest) Assert

func (m *BPDFTest) Assert(structure *node.Node[core.Structure]) *BPDFTest

Assert validates if the structure is the same as defined by Equals method.

func (*BPDFTest) Equals

func (m *BPDFTest) Equals(file string) *BPDFTest

Equals defines which file will be loaded to do the comparison.

func (*BPDFTest) Save

func (m *BPDFTest) Save(file string) *BPDFTest

Save is an auxiliary method to update the file to be asserted.

type Config

type Config struct {
	AbsolutePath string
	TestPath     string `yaml:"test_path"`
}

Config is the representation of a test config.

type Node

type Node struct {
	Value   interface{}            `json:"value,omitempty"`
	Type    string                 `json:"type"`
	Details map[string]interface{} `json:"details,omitempty"`
	Nodes   []*Node                `json:"nodes,omitempty"`
}

Jump to

Keyboard shortcuts

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