-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack_test.go
59 lines (42 loc) · 840 Bytes
/
stack_test.go
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
58
59
package kama
import (
"bytes"
"io"
"testing"
"go.akshayshah.org/attest"
)
func Test_getStackTrace(t *testing.T) {
t.Parallel()
t.Run("test-get-stacktraces", func(t *testing.T) {
t.Parallel()
got := a()
attest.Subsequence(t, got[0], "github.com/komuw/kama.a")
})
}
func a() []string {
return b()
}
func b() []string {
return c()
}
// c calls social networks to get network graphs
func c() []string {
return getStackTrace()
}
func Test_stackp(t *testing.T) {
t.Parallel()
t.Run("test-stackp", func(t *testing.T) {
t.Parallel()
w := &bytes.Buffer{}
d(w)
attest.Subsequence(t, w.String(), "kama.Test_stackp")
})
t.Run("test-stack", func(t *testing.T) {
t.Parallel()
res := Stack()
attest.Subsequence(t, res, "github.com/komuw/kama.Test_stackp")
})
}
func d(w io.Writer) {
stackp(w, false)
}