mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
tpl: Fix test to pass with gccgo
When run under gccgo, the test looks for the name that gccgo gives to a thunk method. This name is not normally visible, but can be seen when using reflect.FuncForPC as this code does. That name changed in https://golang.org/cl/89555. Change the test to work with both the old name "$thunk0" and the new name "thunk0". Fixes golang/go#28669
This commit is contained in:
parent
2900801acf
commit
a8cb1b07b4
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ func TestMethodToName(t *testing.T) {
|
||||||
test := &Test{}
|
test := &Test{}
|
||||||
|
|
||||||
if runtime.Compiler == "gccgo" {
|
if runtime.Compiler == "gccgo" {
|
||||||
require.Equal(t, "$thunk0", methodToName(test.MyTestMethod))
|
require.Contains(t, methodToName(test.MyTestMethod), "thunk")
|
||||||
} else {
|
} else {
|
||||||
require.Equal(t, "MyTestMethod", methodToName(test.MyTestMethod))
|
require.Equal(t, "MyTestMethod", methodToName(test.MyTestMethod))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue