Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / mvdan.cc / gofumpt@v0.0.0-20200802201014-ab5a8192947d / gofumports / main_test.go
1 // Copyright (c) 2019, Daniel Martí <mvdan@mvdan.cc>
2 // See LICENSE for licensing information
3
4 package main
5
6 import (
7         "os"
8         "path/filepath"
9         "testing"
10
11         "github.com/rogpeppe/go-internal/gotooltest"
12         "github.com/rogpeppe/go-internal/testscript"
13 )
14
15 func TestMain(m *testing.M) {
16         os.Exit(testscript.RunMain(m, map[string]func() int{
17                 "gofumpt": func() int {
18                         // Don't change gofmtMain, to keep changes to the gofmt
19                         // codebase to a minimum.
20                         gofmtMain()
21                         return exitCode
22                 },
23         }))
24 }
25
26 func TestScripts(t *testing.T) {
27         t.Parallel()
28         p := testscript.Params{
29                 Dir: filepath.Join("..", "testdata", "scripts"),
30                 Condition: func(cond string) (bool, error) {
31                         return false, nil
32                 },
33         }
34         if err := gotooltest.Setup(&p); err != nil {
35                 t.Fatal(err)
36         }
37         testscript.Run(t, p)
38 }