tpl: Accommodate gccgo in TestMethodToName

Fixes #3744
This commit is contained in:
Anthony Fok 2017-07-27 23:28:43 -06:00 committed by Bjørn Erik Pedersen
parent 55d0b89417
commit 555a9bc806

View file

@ -14,6 +14,7 @@
package internal
import (
"runtime"
"testing"
"github.com/stretchr/testify/require"
@ -29,5 +30,9 @@ func (t *Test) MyTestMethod() string {
func TestMethodToName(t *testing.T) {
test := &Test{}
require.Equal(t, "MyTestMethod", methodToName(test.MyTestMethod))
if runtime.Compiler == "gccgo" {
require.Equal(t, "$thunk0", methodToName(test.MyTestMethod))
} else {
require.Equal(t, "MyTestMethod", methodToName(test.MyTestMethod))
}
}