test
is a simple and flexible testing library for Go, designed to work
seamlessly with the standard testing
package provided by Go. It offers
additional functionality with color-coded output and columnized messages for
easier reading of test results.
Use the go get command to add test
to your project:
go get github.com/muxit-studio/test
This package provides two main components - assert
and require
.
import (
"testing"
"github.com/muxit-studio/test/assert"
)
func TestSomething(t *testing.T) {
result := someFunction()
expected := "expected result"
assert.Equal(t, result, expected, "Result should match expected value")
}
import (
"testing"
"github.com/muxit-studio/test/require"
)
func TestSomethingElse(t *testing.T) {
result := someOtherFunction()
expected := "expected result"
require.Equal(t, result, expected, "Result should match expected value")
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.