Updated TableDrivenTests (markdown)

ayan george 2022-08-09 14:21:14 -04:00
parent 05cbc2daa2
commit 341568c2e8

@ -66,11 +66,11 @@ func TestTLog(t *testing.T) {
{"test 3"},
{"test 4"},
}
for _, tt := range tests {
tt := tt // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(tt.name, func(t *testing.T) {
for _, test := range tests {
test := test // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(test.name, func(t *testing.T) {
t.Parallel() // marks each test case as capable of running in parallel with each other
t.Log(tt.name)
t.Log(test.name)
})
}
}