1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
// Copyright (c) 2016, Daniel Martà <mvdan@mvdan.cc>
// See LICENSE for licensing information
package main
import (
"flag"
"os"
"path/filepath"
"testing"
"github.com/rogpeppe/go-internal/testscript"
)
func TestMain(m *testing.M) {
os.Exit(testscript.RunMain(m, map[string]func() int{
"shfmt": main1,
}))
}
var update = flag.Bool("u", false, "update testscript output files")
func TestScript(t *testing.T) {
t.Parallel()
testscript.Run(t, testscript.Params{
Dir: filepath.Join("testdata", "script"),
UpdateScripts: *update,
RequireExplicitExec: true,
})
}
|