Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vcaesar/tt
Simple and colorful test tools
https://github.com/vcaesar/tt
assert go golang test testing
Last synced: about 2 months ago
JSON representation
Simple and colorful test tools
- Host: GitHub
- URL: https://github.com/vcaesar/tt
- Owner: vcaesar
- License: apache-2.0
- Created: 2018-04-03T11:47:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T20:02:47.000Z (7 months ago)
- Last Synced: 2024-10-14T21:57:52.956Z (2 months ago)
- Topics: assert, go, golang, test, testing
- Language: Go
- Size: 70.3 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - Tt - Simple and colorful test tools. (Testing / Testing Frameworks)
- awesome-go - tt - Simple and colorful test tools - ★ 2 (Testing)
- awesome-go-extra - tt - 04-03T11:47:21Z|2022-04-23T20:51:32Z| (Testing / Testing Frameworks)
README
# tt
Simple and colorful test tools[![CircleCI Status](https://circleci.com/gh/vcaesar/tt.svg?style=shield)](https://circleci.com/gh/vcaesar/tt)
![Appveyor](https://ci.appveyor.com/api/projects/status/github/vcaesar/tt?branch=master&svg=true)
[![codecov](https://codecov.io/gh/vcaesar/tt/branch/master/graph/badge.svg)](https://codecov.io/gh/vcaesar/tt)
[![Build Status](https://travis-ci.org/vcaesar/tt.svg)](https://travis-ci.org/vcaesar/tt)
[![Go Report Card](https://goreportcard.com/badge/github.com/vcaesar/tt)](https://goreportcard.com/report/github.com/vcaesar/tt)
[![GoDoc](https://godoc.org/github.com/vcaesar/tt?status.svg)](https://godoc.org/github.com/vcaesar/tt)
[![Release](https://github-release-version.herokuapp.com/github/vcaesar/tt/release.svg?style=flat)](https://github.com/vcaesar/tt/releases/latest)
[![Join the chat at https://gitter.im/go-ego/ego](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-ego/ego?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)## Installation/Update
```
go get -u github.com/vcaesar/tt
```## Usage:
#### [Look at an example](/example/)
```go
package ttimport (
"fmt"
"testing""github.com/vcaesar/tt"
"github.com/vcaesar/tt/example"
)func TestAdd(t *testing.T) {
fmt.Println(add.Add(1, 1))tt.Expect(t, "1", add.Add(1, 1))
tt.Expect(t, "2", add.Add(1, 1))tt.Equal(t, 1, add.Add(1, 1))
tt.Equal(t, 2, add.Add(1, 1))at := tt.New(t)
at.Expect("2", add.Add(1, 1))
at.Equal(2, add.Add(1, 1))
}func Benchmark1(b *testing.B) {
at := tt.New(b)
fn := func() {
at.Equal(2, add.Add(1, 1))
}tt.BM(b, fn)
// at.BM(b, fn)
}func Benchmark2(b *testing.B) {
at := tt.New(b)
for i := 0; i < b.N; i++ {
at.Equal(2, Add(1, 1))
}
}```
## Thanks[Testify](https://github.com/stretchr/testify), the code has some inspiration.