Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/futile/go-lil-t
Little testing-helpers for go
https://github.com/futile/go-lil-t
Last synced: 12 days ago
JSON representation
Little testing-helpers for go
- Host: GitHub
- URL: https://github.com/futile/go-lil-t
- Owner: futile
- License: cc0-1.0
- Created: 2014-05-26T23:23:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-26T23:40:32.000Z (over 10 years ago)
- Last Synced: 2024-06-21T11:48:40.510Z (5 months ago)
- Language: Go
- Size: 152 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-lil-t
========I wrote these two little helpers, `If` and `IfNot`, to replace testing code such as:
```go
if result == nil {
t.Errorf("error")
}
```with the much shorter:
```go
If(result == nil).Errorf("error")
```which is much more readable. Also it helps to remove clutter from tests.
Example:
---------```go
package exampleimport (
"testing""github.com/futile/go-lil-t"
)func TestMyStuff(t *testing.T) {
If, IfNot := lilt.New(t)If(false).Errorf("critical bug")
IfNot(true).Errorf("another critical bug")
}
```