(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestFuncname(t *testing.T) { |
| 96 | tests := []struct { |
| 97 | name, want string |
| 98 | }{ |
| 99 | {"", ""}, |
| 100 | {"runtime.main", "main"}, |
| 101 | {"github.com/pkg/errors.funcname", "funcname"}, |
| 102 | {"funcname", "funcname"}, |
| 103 | {"io.copyBuffer", "copyBuffer"}, |
| 104 | {"main.(*R).Write", "(*R).Write"}, |
| 105 | } |
| 106 | |
| 107 | for _, tt := range tests { |
| 108 | got := funcname(tt.name) |
| 109 | want := tt.want |
| 110 | if got != want { |
| 111 | t.Errorf("funcname(%q): want: %q, got %q", tt.name, want, got) |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestStackTrace(t *testing.T) { |
| 117 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…