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