Last active
November 19, 2019 01:53
-
-
Save nasa9084/8d301d5787bb24d2b920e8d9cd14fa91 to your computer and use it in GitHub Desktop.
table driven test template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestFoo(t *testing.T) { | |
tests := []struct { | |
// test case structure | |
}{ | |
// test cases | |
} | |
for i, tt := range tests { | |
t.Run(strconv.Itoa(i) + "/" /* if you have any labels, append to test title */, func(t *testing.T) { | |
// test | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment