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/value_test.go
Solomon Hykes c5842f894a clean up & bugfix
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-01-07 16:54:52 -08:00

40 lines
672 B
Go

package dagger
import (
"testing"
)
func TestSimple(t *testing.T) {
cc := &Compiler{}
_, err := cc.EmptyStruct()
if err != nil {
t.Fatal(err)
}
}
func TestCompileBootScript(t *testing.T) {
cc := &Compiler{}
cfg, err := cc.Compile("boot.cue", defaultBootScript)
if err != nil {
t.Fatal(err)
}
s, err := cfg.Get("bootscript").Script()
if err != nil {
t.Fatal(err)
}
if err := s.Validate(); err != nil {
t.Fatal(err)
}
}
func TestCompileSimpleScript(t *testing.T) {
cc := &Compiler{}
s, err := cc.CompileScript("simple.cue", `[{do: "local", dir: "."}]`)
if err != nil {
t.Fatal(err)
}
if err := s.Validate(); err != nil {
t.Fatal(err)
}
}