matcha

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 2 Imported by: 0

README

go-matcha

go-matcha is a simple matcher for Go. It provides the flexible matching of various value and type.

How to Use


matcha.Equal(1, 1) // true
matcha.Equal(matcher.BeAny(), 1)           // any value is expected and return "true"
matcha.Equal(matcher.BeInt(), 1)           // int is expected and return "true"
matcha.Equal(matcher.BeString(), 1)        // string is expected and return "false"
matcha.Equal(matcher.BeInt().Not(), 1)     // not int is expected and return "false"
matcha.Equal(matcher.BeInt().Pointer(), 1) // pointer int is expected and return "false"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(expect, target any) bool

func Records

func Records(r any) []matcher.Record

func Test

func Test(t assert.Testing, expect any, target any)

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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