shithub: hugo

Download patch

ref: 555a9bc80653597a5c5c82fe84222813dfe5aff8
parent: 55d0b89417651eba3ae51c96bd9de9e0daa0399e
author: Anthony Fok <[email protected]>
date: Thu Jul 27 19:28:43 EDT 2017

tpl: Accommodate gccgo in TestMethodToName

Fixes #3744

--- a/tpl/internal/templatefuncRegistry_test.go
+++ b/tpl/internal/templatefuncRegistry_test.go
@@ -14,6 +14,7 @@
 package internal
 
 import (
+	"runtime"
 	"testing"
 
 	"github.com/stretchr/testify/require"
@@ -29,5 +30,9 @@
 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))
+	}
 }