assertion

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package assertion provides a set of utilities for making assertions in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(obj any) bool

Empty checks if an object is empty

func Equal

func Equal(expected, actual any) bool

Equal compares the expected and actual values and logs an error if they are not equal

func HasValue

func HasValue(m map[string]any, value any) bool

HasValue logs an error if the value is not a member of the map

func Len

func Len(obj any, expected int) bool

Len checks if the length of an object is equal to the expected length

func ListHas

func ListHas(value any, list ...any) bool

ListHas logs an error if the list does not contain the value

func ListMissing

func ListMissing(t *testing.T, value any, list ...any) bool

ListMissing logs an error if the list contains the value

func MapContains

func MapContains(m map[string]any, key string, value any) bool

MapContains logs an error if the map does not contain the key-value pair

func MapMissing

func MapMissing(m map[string]any, key string, value any) bool

MapMissing logs an error if the map contains the key-value pair

func NotEmpty added in v1.0.2

func NotEmpty(obj any) bool

func NotEqual

func NotEqual(expected, actual any) bool

NotEqual compares the expected and actual values and logs an error if they are equal

Types

This section is empty.

Jump to

Keyboard shortcuts

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