compare

package module
v0.0.0-...-5ebae12 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 11 Imported by: 0

README

compare

Compare testing

package compare // import "github.com/Konstantin8105/compare"


CONSTANTS

const (
	Key      = "UPDATE"
	KeyValid = "true"
)
    Basic values


FUNCTIONS

func Save(filename string, img image.Image) (err error)
    Save `.png` files

func Test(t Testing, filename string, actual []byte)
    for update test screens run in console: UPDATE=true go test

func TestPng(t Testing, filename string, actual image.Image)
    TestPng compare `.png` files for update test screens run in console:
    UPDATE=true go test


TYPES

type Testing interface {
	Errorf(format string, args ...any)
}
    Testing interface is valid for *testing.T

Documentation

Index

Constants

View Source
const (
	Key      = "UPDATE"
	KeyValid = "true"
)

Basic values

Variables

This section is empty.

Functions

func Save

func Save(filename string, img image.Image) (err error)

Save `.png` files

func Test

func Test(t Testing, filename string, actual []byte)

for update test screens run in console: UPDATE=true go test

func TestDiff

func TestDiff(t Testing, actual, expect []byte)

TestDiff will print two strings vertically next to each other so that line differences are easier to read.

func TestPng

func TestPng(t Testing, filename string, actual image.Image)

TestPng compare `.png` files for update test screens run in console: UPDATE=true go test

Types

type Testing

type Testing interface {
	Errorf(format string, args ...any)
}

Testing interface is valid for *testing.T

Jump to

Keyboard shortcuts

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