diff --git a/format/format_test.go b/format/format_test.go index 32dc197..e208521 100644 --- a/format/format_test.go +++ b/format/format_test.go @@ -6,7 +6,7 @@ package format_test import ( "testing" - qt "github.com/frankban/quicktest" + "github.com/go-quicktest/qt" "mvdan.cc/gofumpt/format" ) @@ -33,6 +33,6 @@ func f() { } `[1:]) got, err := format.Source(in, format.Options{}) - qt.Assert(t, err, qt.IsNil) - qt.Assert(t, string(got), qt.Equals, string(want)) + qt.Assert(t, qt.IsNil(err)) + qt.Assert(t, qt.Equals(string(got), string(want))) } diff --git a/format/fuzz_test.go b/format/fuzz_test.go index 9cfe892..8dfa113 100644 --- a/format/fuzz_test.go +++ b/format/fuzz_test.go @@ -11,18 +11,18 @@ import ( "strings" "testing" - qt "github.com/frankban/quicktest" + "github.com/go-quicktest/qt" "golang.org/x/tools/txtar" ) func FuzzFormat(f *testing.F) { // Initialize the corpus with the Go files from our test scripts. paths, err := filepath.Glob(filepath.Join("..", "testdata", "script", "*.txtar")) - qt.Assert(f, err, qt.IsNil) - qt.Assert(f, paths, qt.Not(qt.HasLen), 0) + qt.Assert(f, qt.IsNil(err)) + qt.Assert(f, qt.Not(qt.HasLen(paths, 0))) for _, path := range paths { archive, err := txtar.ParseFile(path) - qt.Assert(f, err, qt.IsNil) + qt.Assert(f, qt.IsNil(err)) for _, file := range archive.Files { f.Logf("adding %s from %s", file.Name, path) if strings.HasSuffix(file.Name, ".go") || strings.Contains(file.Name, ".go.") { @@ -48,7 +48,7 @@ func FuzzFormat(f *testing.F) { if errors.As(err, &scanner.ErrorList{}) { return // invalid syntax from parsing } - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) _ = formatted // TODO: verify that the result is idempotent @@ -58,7 +58,7 @@ func FuzzFormat(f *testing.F) { // TODO: check calling format.Node directly as well - qt.Assert(t, string(orig), qt.Equals, src, + qt.Assert(t, qt.Equals(string(orig), src), qt.Commentf("input source bytes were modified")) }) } diff --git a/go.mod b/go.mod index 024f445..c973b93 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module mvdan.cc/gofumpt go 1.21 require ( - github.com/frankban/quicktest v1.14.6 + github.com/go-quicktest/qt v1.101.0 github.com/google/go-cmp v0.6.0 github.com/rogpeppe/go-internal v1.12.0 golang.org/x/mod v0.14.0 diff --git a/go.sum b/go.sum index f8d8ce5..6f95386 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= -github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/main_test.go b/main_test.go index 53627e3..9ecc3fe 100644 --- a/main_test.go +++ b/main_test.go @@ -11,7 +11,7 @@ import ( "path/filepath" "testing" - qt "github.com/frankban/quicktest" + "github.com/go-quicktest/qt" "github.com/rogpeppe/go-internal/gotooltest" "github.com/rogpeppe/go-internal/testscript" @@ -53,6 +53,6 @@ func TestScript(t *testing.T) { }, } err = gotooltest.Setup(&p) - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) testscript.Run(t, p) } diff --git a/ulimit_linux_test.go b/ulimit_linux_test.go index 8924269..4743480 100644 --- a/ulimit_linux_test.go +++ b/ulimit_linux_test.go @@ -12,7 +12,7 @@ import ( "strconv" "testing" - qt "github.com/frankban/quicktest" + "github.com/go-quicktest/qt" "golang.org/x/sys/unix" ) @@ -37,7 +37,7 @@ func TestWithLowOpenFileLimit(t *testing.T) { tempDir := t.TempDir() testBinary, err := os.Executable() - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) const ( // Enough directories to run into the ulimit. @@ -55,18 +55,18 @@ func TestWithLowOpenFileLimit(t *testing.T) { dirName := fmt.Sprintf("p%03d", i) dirPath := filepath.Join(tempDir, dirName) err := os.MkdirAll(dirPath, 0o777) - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) err = os.WriteFile(filepath.Join(dirPath, "go.mod"), []byte(fmt.Sprintf("module %s\n\ngo 1.16", dirName)), 0o666) - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) for j := 0; j < numberFilesPerDir; j++ { filePath := filepath.Join(dirPath, fmt.Sprintf("%03d.go", j)) err := os.WriteFile(filePath, // Extra newlines so that "-l" prints all paths. []byte(fmt.Sprintf("package %s\n\n\n", dirName)), 0o666) - qt.Assert(t, err, qt.IsNil) + qt.Assert(t, qt.IsNil(err)) allGoFiles = append(allGoFiles, filePath) } } @@ -83,8 +83,8 @@ func TestWithLowOpenFileLimit(t *testing.T) { if err, _ := err.(*exec.ExitError); err != nil { stderr = err.Stderr } - qt.Assert(t, err, qt.IsNil, qt.Commentf("stderr:\n%s", stderr)) - qt.Assert(t, bytes.Count(out, []byte("\n")), qt.Equals, len(allGoFiles)) + qt.Assert(t, qt.IsNil(err), qt.Commentf("stderr:\n%s", stderr)) + qt.Assert(t, qt.Equals(bytes.Count(out, []byte("\n")), len(allGoFiles))) } runGofmt(tempDir) runGofmt(allGoFiles...)