test

package
v2.0.0-...-e22b400 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package test implements unit test feature.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config is the representation of a test config.

type MarotoTest

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

MarotoTest is the unit test instance.

func New

func New(t *testing.T) *MarotoTest

New creates the MarotoTest instance to unit tests.

func (*MarotoTest) Assert

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

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

func (*MarotoTest) Equals

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

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

func (*MarotoTest) Save

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

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

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