diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-11-09 10:54:08 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-11-09 10:54:08 +0300 |
commit | a8cb1b07b4cf7fcf0e949657cb03c1a4838f975e (patch) | |
tree | 785d5f4b173e717a5e6ae9b39a111b57c5c8a63a /tpl/internal | |
parent | 2900801acfdc06ec5631fc5772d1b82d0d671915 (diff) |
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
Diffstat (limited to 'tpl/internal')
-rw-r--r-- | tpl/internal/templatefuncRegistry_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/internal/templatefuncRegistry_test.go b/tpl/internal/templatefuncRegistry_test.go index c21948077..ec7fbeb1a 100644 --- a/tpl/internal/templatefuncRegistry_test.go +++ b/tpl/internal/templatefuncRegistry_test.go @@ -31,7 +31,7 @@ func TestMethodToName(t *testing.T) { test := &Test{} if runtime.Compiler == "gccgo" { - require.Equal(t, "$thunk0", methodToName(test.MyTestMethod)) + require.Contains(t, methodToName(test.MyTestMethod), "thunk") } else { require.Equal(t, "MyTestMethod", methodToName(test.MyTestMethod)) } |