asrt

package module
v0.0.0-...-06fb6ba Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 3 Imported by: 0

README

asrt

asrt helps you to do something you won't do, just check it all.

Getting Started

Install

go get -u "github.com/i0Ek3/asrt"

Usage
package main

import (
    "github.com/i0Ek3/asrt"
)

func main() {
    //...
    asrt.Asrt(t, got, want)
    asrt.Equal(got, want)
    asrt.NotEqual(got, want)
    asrt.NotNil(value)
    asrt.Neg(prevalue, neg)
}

TODO

  • generic support
  • error showing

Contributing

PRs and Issues are also welcome.

License

MIT.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asrt

func Asrt(t *testing.T, got, want T)

Asrt outputs error message when got not equal with want

func AssertType

func AssertType(t T) string

AssertType asserts the value type

func Equal

func Equal(got, want T) bool

Equal checks if the give value is equal

func Neg

func Neg(prepare, neg T) bool

Neg checks if prevalue equals given value neg

func NotEqual

func NotEqual(got, want T) bool

NotEqual checks if the given value is not equal

func NotNil

func NotNil(value T) bool

NotNil checks if the given value is nil

Types

type T

type T interface{}

T ready for generic

Jump to

Keyboard shortcuts

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