From 434fa14f3d25febd29ae3783bbe7bca6f6d4856f Mon Sep 17 00:00:00 2001 From: John Episcopo Date: Thu, 2 May 2019 09:47:29 +0100 Subject: [PATCH] Added test to check the creation of the walker is --- walker_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/walker_test.go b/walker_test.go index a2f7772..81877af 100644 --- a/walker_test.go +++ b/walker_test.go @@ -9,6 +9,24 @@ import ( "github.com/stretchr/testify/assert" ) +func TestWalkReturnsCorrectlyPopulatedWalker(t *testing.T) { + mock, err := newFtpMock(t, "127.0.0.1") + if err != nil { + t.Fatal(err) + } + defer mock.Close() + + c, cErr := Connect(mock.Addr()) + if cErr != nil { + t.Fatal(err) + } + + w := c.Walk("root") + + assert.Equal(t, "root/", w.root) + assert.Equal(t, &c, &w.serverConn) +} + func TestFieldsReturnCorrectData(t *testing.T) { w := Walker{ cur: item{