tpl: Accommodate gccgo in TestMethodToName
authorAnthony Fok <foka@debian.org>
Fri, 28 Jul 2017 05:28:43 +0000 (23:28 -0600)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 28 Jul 2017 06:03:15 +0000 (08:03 +0200)
Fixes #3744

tpl/internal/templatefuncRegistry_test.go

index dfc4ba09bc5c7ad6491da1b1d8526bfb2732e73b..c21948077cfb3df7dfcfcdc5eca6544b595f863a 100644 (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))
+       }
 }