mtest

module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: BSD-2-Clause

README

mtest

Small unit testing helper library.

A vastly simplified version of Testify. Custom assertions are nice, but most of the time they are overkill.

This library only implements:

  • True(t *testing.TB, ok bool)
  • False(t *testing.TB, ok bool)
  • Equal(t *testing.TB, expected, actual any)
  • Error(t *testing.TB, err error)
  • NoError(t *testing.TB, err error)
  • Panics(t *testing.TB, fn func())

Install:

go get git.sr.ht/~mikattack/mtest

Example:

package yours

import (
  "testing"

  "git.sr.ht/~mikattack/mtest/assert"
)

func TestSomething(t *testing.T) {
  assert.Equal(t, 123, 123) // Pass
  assert.Equal(t, 123, 321) // Fail

  assert.Error(t, errors.New("intentional")) // Pass
  assert.NoError(t, "not an error") // Pass
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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