MCPcopy
hub / github.com/dropbox/godropbox / TestRootErrors

Function TestRootErrors

errors/errors_test.go:63–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func TestRootErrors(t *testing.T) {
64 const (
65 innerMsg = "inner error"
66 middleMsg = "middle error"
67 outerMsg = "outer error"
68 )
69 inner := fmt.Errorf(innerMsg)
70 middle := Wrap(inner, middleMsg)
71 outer := Wrap(middle, outerMsg)
72
73 root := RootError(outer)
74 rootDropbox := RootDropboxError(outer)
75 if root != inner {
76 t.Errorf("Got wrong RootError. %s", root)
77 }
78 if rootDropbox != middle {
79 t.Errorf("Got wrong RootDropbox %s", rootDropbox)
80 }
81}
82
83func TestStackAddrs(t *testing.T) {
84 pat := regexp.MustCompile("^0x[a-h0-9]+( 0x[a-h0-9]+)*$")

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.85
RootErrorFunction · 0.85
RootDropboxErrorFunction · 0.85

Tested by

no test coverage detected