Reputation: 6154
The recommended golang test method signature format is:
func TestMxxxx(t *testing.T) {
}
I have noticed if I use 'Testmxxxx', it simply skips the tests. Now, if I have two function in a package, one name myFunc (as private, not exported), and another Myfunc(exported). What will be the approach to write separate test method for each of them?
Upvotes: 2
Views: 81
Reputation: 36199
You can use underscores. E.g.
func Test_mxxxx(t *testing.T) {
// ...
}
This should run just fine.
Upvotes: 3