forked from mirror/pkger
now with less printlns and more tests
This commit is contained in:
parent
812232aaff
commit
794943f042
2
Makefile
2
Makefile
|
@ -17,7 +17,7 @@ build: tidy
|
|||
make tidy
|
||||
|
||||
test: tidy
|
||||
$(GO_BIN) test -cover -tags ${TAGS} -timeout 5s ./...
|
||||
$(GO_BIN) test -count 1 -cover -tags ${TAGS} -timeout 10s ./...
|
||||
make tidy
|
||||
|
||||
cov:
|
||||
|
|
|
@ -2,7 +2,6 @@ package here
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
@ -93,9 +92,9 @@ func dir(p string) (Info, error) {
|
|||
}
|
||||
|
||||
func fromNonGoDir(dir string) (Info, error) {
|
||||
fmt.Println(">>>TODO here/dir.go:59: dir ", dir)
|
||||
i := Info{
|
||||
Dir: dir,
|
||||
Name: filepath.Base(dir),
|
||||
}
|
||||
|
||||
b, err := run("go", "list", "-json", "-m")
|
||||
|
|
|
@ -49,13 +49,18 @@ func Test_Dir(t *testing.T) {
|
|||
t.Run(tt.in, func(st *testing.T) {
|
||||
r := require.New(st)
|
||||
|
||||
_, err = here.Dir(tt.in)
|
||||
info, err := here.Dir(tt.in)
|
||||
if tt.err {
|
||||
r.Error(err)
|
||||
return
|
||||
}
|
||||
r.NoError(err)
|
||||
|
||||
r.NotZero(info)
|
||||
r.NotZero(info.Dir)
|
||||
r.NotZero(info.Name)
|
||||
r.NotZero(info.Module)
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ type Ref struct {
|
|||
}
|
||||
|
||||
func NewRef() (*Ref, error) {
|
||||
here.ClearCache()
|
||||
her, err := here.Package("github.com/markbates/pkger")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -2,6 +2,9 @@ module app
|
|||
|
||||
go 1.13
|
||||
|
||||
require github.com/markbates/pkger v0.0.0
|
||||
require (
|
||||
github.com/gobuffalo/buffalo v0.15.0 // indirect
|
||||
github.com/markbates/pkger v0.0.0
|
||||
)
|
||||
|
||||
replace github.com/markbates/pkger => ../../../../
|
||||
|
|
Loading…
Reference in New Issue