From f83c92f3e96368b7d030f8371e535c522c71c9ec Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Sun, 1 Sep 2019 18:05:54 -0400 Subject: [PATCH] somebody take me --- pkging/memware/warehouse_test.go | 6 +++--- pkging/waretest/file.go | 12 ------------ pkging/waretest/fstest.go | 31 ------------------------------- pkging/waretest/waretest.go | 1 + 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 pkging/waretest/file.go delete mode 100644 pkging/waretest/fstest.go create mode 100644 pkging/waretest/waretest.go diff --git a/pkging/memware/warehouse_test.go b/pkging/memware/warehouse_test.go index 9df9440..9eb1032 100644 --- a/pkging/memware/warehouse_test.go +++ b/pkging/memware/warehouse_test.go @@ -15,12 +15,12 @@ func Test_Warehouse(t *testing.T) { r.NoError(err) r.NotZero(info) - mypkging, err := New(info) + wh, err := New(info) r.NoError(err) - WithInfo(mypkging, info) + WithInfo(wh, info) - suite, err := waretest.NewSuite(mypkging) + suite, err := waretest.NewSuite(wh) r.NoError(err) suite.Test(t) diff --git a/pkging/waretest/file.go b/pkging/waretest/file.go deleted file mode 100644 index 9bddf94..0000000 --- a/pkging/waretest/file.go +++ /dev/null @@ -1,12 +0,0 @@ -package waretest - -import ( - "github.com/markbates/pkger/pkging" -) - -type TestFile struct { - Name string - Path pkging.Path -} - -type TestFiles map[pkging.Path]TestFile diff --git a/pkging/waretest/fstest.go b/pkging/waretest/fstest.go deleted file mode 100644 index 1aacef7..0000000 --- a/pkging/waretest/fstest.go +++ /dev/null @@ -1,31 +0,0 @@ -package waretest - -import ( - "github.com/markbates/pkger/pkging" -) - -func Files(fx pkging.Warehouse) (TestFiles, error) { - tf := TestFiles{} - for _, f := range fileList { - pt, err := fx.Parse(f) - if err != nil { - return tf, err - } - tf[pt] = TestFile{ - Name: pt.Name, - Path: pt, - } - } - - return tf, nil -} - -var fileList = []string{ - "/main.go", - "/go.mod", - "/go.sum", - "/public/index.html", - "/public/images/mark.png", - "/templates/a.txt", - "/templates/b/b.txt", -} diff --git a/pkging/waretest/waretest.go b/pkging/waretest/waretest.go new file mode 100644 index 0000000..92b37c8 --- /dev/null +++ b/pkging/waretest/waretest.go @@ -0,0 +1 @@ +package waretest