Add test to reproduce crash computing examples/simple

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes 2021-01-09 17:22:51 -08:00
parent 27a44a9e58
commit 216e808465

View File

@ -5,6 +5,17 @@ import (
"testing" "testing"
) )
func TestValidateEmptyValue(t *testing.T) {
cc := &Compiler{}
v, err := cc.Compile("", "#dagger: compute: _")
if err != nil {
t.Fatal(err)
}
if err := v.Get("#dagger.compute").Validate("#Script"); err != nil {
t.Fatal(err)
}
}
func TestLocalScript(t *testing.T) { func TestLocalScript(t *testing.T) {
cc := &Compiler{} cc := &Compiler{}
src := `[{do: "local", dir: "foo"}]` src := `[{do: "local", dir: "foo"}]`