diff options
author | Adin Scannell <ascannell@google.com> | 2018-09-07 16:52:02 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-07 16:53:12 -0700 |
commit | 6cfb5cd56d4660cc0de6cd991a7ed4601824a7e6 (patch) | |
tree | 9c197fdc7083acebc1b89eeed3bfd458bd8ab6d2 /pkg/p9/p9test/mocks.go | |
parent | 8ce3fbf9f87677ac34c577be9fb9b395ede8e714 (diff) |
Add additional sanity checks for walk.
PiperOrigin-RevId: 212058684
Change-Id: I319709b9ffcfccb3231bac98df345d2a20eca24b
Diffstat (limited to 'pkg/p9/p9test/mocks.go')
-rw-r--r-- | pkg/p9/p9test/mocks.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/p9/p9test/mocks.go b/pkg/p9/p9test/mocks.go index e10f206dd..9d039ac63 100644 --- a/pkg/p9/p9test/mocks.go +++ b/pkg/p9/p9test/mocks.go @@ -71,7 +71,8 @@ type WalkGetAttrMock struct { // WalkGetAttr implements p9.File.WalkGetAttr. func (w *WalkGetAttrMock) WalkGetAttr(names []string) ([]p9.QID, p9.File, p9.AttrMask, p9.Attr, error) { - w.Called, w.Names = true, names + w.Called = true + w.Names = append(w.Names, names...) return w.QIDs, w.File, w.Valid, w.Attr, w.Err } @@ -300,17 +301,14 @@ func (r *ReadlinkMock) Readlink() (string, error) { type AttachMock struct { Called bool - // Args. - AttachName string - // Return. File p9.File Err error } // Attach implements p9.Attacher.Attach. -func (a *AttachMock) Attach(attachName string) (p9.File, error) { - a.Called, a.AttachName = true, attachName +func (a *AttachMock) Attach() (p9.File, error) { + a.Called = true return a.File, a.Err } @@ -329,7 +327,8 @@ type WalkMock struct { // Walk implements p9.File.Walk. func (w *WalkMock) Walk(names []string) ([]p9.QID, p9.File, error) { - w.Called, w.Names = true, names + w.Called = true + w.Names = append(w.Names, names...) return w.QIDs, w.File, w.Err } |