This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/dagger/input_test.go

32 lines
515 B
Go
Raw Normal View History

package dagger
import (
"testing"
)
func TestEnvInputFlag(t *testing.T) {
env, err := NewRoute()
if err != nil {
t.Fatal(err)
}
input, err := NewInputValue(`{}`)
if err != nil {
t.Fatal(err)
}
if err := input.DirFlag().Set("www.source=."); err != nil {
t.Fatal(err)
}
if err := env.SetInput(input.Value()); err != nil {
t.Fatal(err)
}
localdirs := env.LocalDirs()
if len(localdirs) != 1 {
t.Fatal(localdirs)
}
if dir, ok := localdirs["."]; !ok || dir != "." {
t.Fatal(localdirs)
}
}