blob: 92e2179991a46c93f9522c4f23058164b12d5d3e [file] [log] [blame]
package basics
import (
"flag"
"os"
"path/filepath"
"testing"
"cuelang.org/go/cmd/cue/cmd"
"github.com/rogpeppe/testscript"
)
var update = flag.Bool("update", false, "update the test files")
func TestScript(t *testing.T) {
filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
return nil
}
testscript.Run(t, testscript.Params{
Dir: path,
UpdateScripts: *update,
})
return nil
})
}
func TestMain(m *testing.M) {
os.Exit(testscript.RunMain(m, map[string]func() int{
"cue": cmd.Main,
}))
}