Skip to content

mpvl/subtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Package subtest

Go 1.7 introduced subtests and sub-benchmarks. This package allows this functionality to be used in a somewhat backwards compatible way.

Using subtest.Run wil get you all the features of subtests in Go 1.7. Subtests pre-Go 1.7 will not be great, but at least all tests will be run.

Example

package foo

import "github.com/mpvl/subtest"

var testCases = ...

func TestFoo(t *testing.T) {
	for _, tc := range testCases {
		subtest.Run(t, tc.name, func(t *testing.T) {
			tc.doTest()
		})
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages