-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathconfig_test.go
More file actions
35 lines (30 loc) · 695 Bytes
/
config_test.go
File metadata and controls
35 lines (30 loc) · 695 Bytes
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
31
32
33
34
35
//go:build !windows
// +build !windows
package main
import (
"flag"
"os"
"testing"
"github.com/rogpeppe/go-internal/gotooltest"
"github.com/rogpeppe/go-internal/testscript"
)
var updateGolden = flag.Bool("update", false, "update golden files")
func TestScripts(t *testing.T) {
wd, err := os.Getwd()
if err != nil {
t.Fatalf("GetWd error: %v", err)
}
params := testscript.Params{
Dir: "testdata",
Setup: func(env *testscript.Env) error {
env.Setenv("GITMUX_DIR", wd)
return nil
},
UpdateScripts: *updateGolden,
TestWork: true,
}
if err := gotooltest.Setup(¶ms); err != nil {
t.Errorf("gotooltest.Setup error: %v", err)
}
testscript.Run(t, params)
}