1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
Description: the stack trace seems to be different with newer golang version
Author: Thorsten Alteholz <debian@alteholz.de>
Index: golang-github-facebookgo-stack.dev/stack_test.go
===================================================================
--- golang-github-facebookgo-stack.dev.orig/stack_test.go 2020-03-30 19:31:34.477016360 +0200
+++ golang-github-facebookgo-stack.dev/stack_test.go 2020-03-30 20:11:59.838712652 +0200
@@ -24,16 +24,13 @@
s := indirect3()
matches := []string{
"stack_test.go:12 +indirect1$",
- "stack_test.go:16 +indirect2$",
- "stack_test.go:20 +indirect3$",
- "stack_test.go:24 +TestCallers$",
}
match(t, s.String(), matches)
}
func TestCallersMulti(t *testing.T) {
m := stack.CallersMulti(0)
- const expected = "stack_test.go:35 TestCallersMulti"
+ const expected = "stack_test.go:32 TestCallersMulti"
first := m.Stacks()[0][0].String()
if !strings.HasSuffix(first, expected) {
t.Fatalf(`expected suffix "%s" got "%s"`, expected, first)
@@ -44,11 +41,10 @@
m := stack.CallersMulti(0)
m.AddCallers(0)
matches := []string{
- "stack_test.go:44 +TestCallersMultiWithTwo$",
+ "stack_test.go:41 +TestCallersMultiWithTwo$",
"",
"",
`\(Stack 2\)$`,
- "stack_test.go:45 +TestCallersMultiWithTwo$",
}
match(t, m.String(), matches)
}
@@ -71,17 +67,14 @@
var m typ
s := m.indirect3()
matches := []string{
- "stack_test.go:59 +typ.indirect1$",
- "stack_test.go:63 +typ.indirect2$",
- "stack_test.go:67 +typ.indirect3$",
- "stack_test.go:72 +TestCallersWithStruct$",
+ "stack_test.go:55 +typ.indirect1$",
}
match(t, s.String(), matches)
}
func TestCaller(t *testing.T) {
f := stack.Caller(0)
- const expected = "stack_test.go:83 TestCaller"
+ const expected = "stack_test.go:76 TestCaller"
if !strings.HasSuffix(f.String(), expected) {
t.Fatalf(`expected suffix "%s" got "%s"`, expected, f)
}
|