From 226f00fd00848f692e3767394ce0f148e191caf3 Mon Sep 17 00:00:00 2001 From: jawr Date: Mon, 15 Jun 2020 09:53:47 +0900 Subject: [PATCH] try and improve coveralls --- walker_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/walker_test.go b/walker_test.go index d557553..9cf6276 100644 --- a/walker_test.go +++ b/walker_test.go @@ -187,3 +187,26 @@ func TestCurAndStackSetCorrectly(t *testing.T) { assert.Equal(t, 0, len(w.stack)) assert.Equal(t, "file", w.cur.entry.Name) } + +func TestCurInit(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") + + result := w.Next() + + // mock fs has one file 'lo' + + assert.Equal(t, true, result, "Result should return false") + assert.Equal(t, 0, len(w.stack)) + assert.Equal(t, "/root/lo", w.Path()) +}