tests: fix input tests

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-03-25 15:46:26 -07:00
parent 9fec69f3a0
commit 0e21144529

View File

@ -6,20 +6,14 @@ import (
"github.com/stretchr/testify/require"
)
func TestEnvInputFlag(t *testing.T) {
func TestInputDir(t *testing.T) {
st := &RouteState{}
require.NoError(t, st.AddInput("www.source", DirInput(".", []string{})))
env, err := NewRoute(st)
if err != nil {
t.Fatal(err)
}
route, err := NewRoute(st)
require.NoError(t, err)
localdirs := env.LocalDirs()
if len(localdirs) != 1 {
t.Fatal(localdirs)
}
if dir, ok := localdirs["."]; !ok || dir != "." {
t.Fatal(localdirs)
}
localdirs := route.LocalDirs()
require.Len(t, localdirs, 1)
require.Equal(t, ".", localdirs["."])
}