Skip to content

Commit 52739c5

Browse files
committed
swap frankban/quicktest for go-quicktest/qt
1 parent 7ccdb87 commit 52739c5

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

format/format_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package format_test
66
import (
77
"testing"
88

9-
qt "github.com/frankban/quicktest"
9+
"github.com/go-quicktest/qt"
1010

1111
"mvdan.cc/gofumpt/format"
1212
)
@@ -33,6 +33,6 @@ func f() {
3333
}
3434
`[1:])
3535
got, err := format.Source(in, format.Options{})
36-
qt.Assert(t, err, qt.IsNil)
37-
qt.Assert(t, string(got), qt.Equals, string(want))
36+
qt.Assert(t, qt.IsNil(err))
37+
qt.Assert(t, qt.Equals(string(got), string(want)))
3838
}

format/fuzz_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ import (
1111
"strings"
1212
"testing"
1313

14-
qt "github.com/frankban/quicktest"
14+
"github.com/go-quicktest/qt"
1515
"golang.org/x/tools/txtar"
1616
)
1717

1818
func FuzzFormat(f *testing.F) {
1919
// Initialize the corpus with the Go files from our test scripts.
2020
paths, err := filepath.Glob(filepath.Join("..", "testdata", "script", "*.txtar"))
21-
qt.Assert(f, err, qt.IsNil)
22-
qt.Assert(f, paths, qt.Not(qt.HasLen), 0)
21+
qt.Assert(f, qt.IsNil(err))
22+
qt.Assert(f, qt.Not(qt.HasLen(paths, 0)))
2323
for _, path := range paths {
2424
archive, err := txtar.ParseFile(path)
25-
qt.Assert(f, err, qt.IsNil)
25+
qt.Assert(f, qt.IsNil(err))
2626
for _, file := range archive.Files {
2727
f.Logf("adding %s from %s", file.Name, path)
2828
if strings.HasSuffix(file.Name, ".go") || strings.Contains(file.Name, ".go.") {
@@ -48,7 +48,7 @@ func FuzzFormat(f *testing.F) {
4848
if errors.As(err, &scanner.ErrorList{}) {
4949
return // invalid syntax from parsing
5050
}
51-
qt.Assert(t, err, qt.IsNil)
51+
qt.Assert(t, qt.IsNil(err))
5252
_ = formatted
5353

5454
// TODO: verify that the result is idempotent
@@ -58,7 +58,7 @@ func FuzzFormat(f *testing.F) {
5858

5959
// TODO: check calling format.Node directly as well
6060

61-
qt.Assert(t, string(orig), qt.Equals, src,
61+
qt.Assert(t, qt.Equals(string(orig), src),
6262
qt.Commentf("input source bytes were modified"))
6363
})
6464
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module mvdan.cc/gofumpt
33
go 1.21
44

55
require (
6-
github.com/frankban/quicktest v1.14.6
6+
github.com/go-quicktest/qt v1.101.0
77
github.com/google/go-cmp v0.6.0
88
github.com/rogpeppe/go-internal v1.12.0
99
golang.org/x/mod v0.14.0

go.sum

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2-
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
3-
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
4-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2+
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
3+
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
54
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
65
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
76
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"path/filepath"
1212
"testing"
1313

14-
qt "github.com/frankban/quicktest"
14+
"github.com/go-quicktest/qt"
1515

1616
"github.com/rogpeppe/go-internal/gotooltest"
1717
"github.com/rogpeppe/go-internal/testscript"
@@ -53,6 +53,6 @@ func TestScript(t *testing.T) {
5353
},
5454
}
5555
err = gotooltest.Setup(&p)
56-
qt.Assert(t, err, qt.IsNil)
56+
qt.Assert(t, qt.IsNil(err))
5757
testscript.Run(t, p)
5858
}

ulimit_linux_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strconv"
1313
"testing"
1414

15-
qt "github.com/frankban/quicktest"
15+
"github.com/go-quicktest/qt"
1616
"golang.org/x/sys/unix"
1717
)
1818

@@ -37,7 +37,7 @@ func TestWithLowOpenFileLimit(t *testing.T) {
3737

3838
tempDir := t.TempDir()
3939
testBinary, err := os.Executable()
40-
qt.Assert(t, err, qt.IsNil)
40+
qt.Assert(t, qt.IsNil(err))
4141

4242
const (
4343
// Enough directories to run into the ulimit.
@@ -55,18 +55,18 @@ func TestWithLowOpenFileLimit(t *testing.T) {
5555
dirName := fmt.Sprintf("p%03d", i)
5656
dirPath := filepath.Join(tempDir, dirName)
5757
err := os.MkdirAll(dirPath, 0o777)
58-
qt.Assert(t, err, qt.IsNil)
58+
qt.Assert(t, qt.IsNil(err))
5959

6060
err = os.WriteFile(filepath.Join(dirPath, "go.mod"),
6161
[]byte(fmt.Sprintf("module %s\n\ngo 1.16", dirName)), 0o666)
62-
qt.Assert(t, err, qt.IsNil)
62+
qt.Assert(t, qt.IsNil(err))
6363

6464
for j := 0; j < numberFilesPerDir; j++ {
6565
filePath := filepath.Join(dirPath, fmt.Sprintf("%03d.go", j))
6666
err := os.WriteFile(filePath,
6767
// Extra newlines so that "-l" prints all paths.
6868
[]byte(fmt.Sprintf("package %s\n\n\n", dirName)), 0o666)
69-
qt.Assert(t, err, qt.IsNil)
69+
qt.Assert(t, qt.IsNil(err))
7070
allGoFiles = append(allGoFiles, filePath)
7171
}
7272
}
@@ -83,8 +83,8 @@ func TestWithLowOpenFileLimit(t *testing.T) {
8383
if err, _ := err.(*exec.ExitError); err != nil {
8484
stderr = err.Stderr
8585
}
86-
qt.Assert(t, err, qt.IsNil, qt.Commentf("stderr:\n%s", stderr))
87-
qt.Assert(t, bytes.Count(out, []byte("\n")), qt.Equals, len(allGoFiles))
86+
qt.Assert(t, qt.IsNil(err), qt.Commentf("stderr:\n%s", stderr))
87+
qt.Assert(t, qt.Equals(bytes.Count(out, []byte("\n")), len(allGoFiles)))
8888
}
8989
runGofmt(tempDir)
9090
runGofmt(allGoFiles...)

0 commit comments

Comments
 (0)