tests: fix input tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
9fec69f3a0
commit
0e21144529
@ -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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user