forked from mirror/pkger
somebody take me
This commit is contained in:
parent
3d94a20bbf
commit
f83c92f3e9
|
@ -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)
|
||||
|
|
|
@ -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
|
|
@ -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",
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
package waretest
|
Loading…
Reference in New Issue