diff --git a/README.md b/README.md index cc0d1a6..25e31c4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Use the `-fix` flag to apply the fix suggestions to the source code. ## Linter Checks ### Wrong Length checks -The linter finds usage of the golang built-in `len` function, and then all kind of matchers, while there are already gomega matchers for these usecases. +The linter finds assertion of the golang built-in `len` function, with all kind of matchers, while there are already gomega matchers for these usecases; We want to assert the item, rather than its length. There are several wrong patterns: ```go @@ -28,9 +28,9 @@ Expect(len(x)).To(BeNumeric("==", 2)) // should be Expect(x).To(HaveLen(2)) Expect(len(x)).To(BeNumeric("!=", 3)) // should be Expect(x).ToNot(HaveLen(3)) ``` -The linter supports the `Expect`, `ExpectWithOffset` and the `Ω` functions, and the `Should`, `ShouldNot`, `To`, `ToNot` and `NotTo` assertion functions. +The linter supports the `Expect`, `ExpectWithOffset` and the `Ω` "actual" functions, and the `Should`, `ShouldNot`, `To`, `ToNot` and `NotTo` assertion functions. -It also supports the embedded `Not()` function; e.g. +It also supports the embedded `Not()` matcher; e.g. `Ω(len(x)).Should(Not(Equal(4)))` => `Ω(x).ShouldNot(HaveLen(4))` @@ -40,19 +40,19 @@ Or even (double negative): The output of the linter,when finding issues, looks like this: ``` -./testdata/src/a/a.go:14:5: ginkgo-linter: wrong length check; consider using `Expect("abcd").Should(HaveLen(4))` instead -./testdata/src/a/a.go:18:5: ginkgo-linter: wrong length check; consider using `Expect("").Should(BeEmpty())` instead -./testdata/src/a/a.go:22:5: ginkgo-linter: wrong length check; consider using `Expect("").Should(BeEmpty())` instead +./testdata/src/a/a.go:14:5: ginkgo-linter: wrong length assertion; consider using `Expect("abcd").Should(HaveLen(4))` instead +./testdata/src/a/a.go:18:5: ginkgo-linter: wrong length assertion; consider using `Expect("").Should(BeEmpty())` instead +./testdata/src/a/a.go:22:5: ginkgo-linter: wrong length assertion; consider using `Expect("").Should(BeEmpty())` instead ``` ## Suppress the linter -To suppress the wrong length check warning, add a comment with (only) -`ginkgo-linter:supressLengthCheckWarning`. There are two options to use this comment: +To suppress the wrong length assertion warning, add a comment with (only) +`ginkgo-linter:ignore-len-assert-warning`. There are two options to use this comment: 1. If the comment is at the top of the file, supress the warning for the whole file; e.g.: ```go package mypackage - // ginkgo-linter:ignore-length-warning + // ginkgo-linter:ignore-len-assert-warning import ( . "github.com/onsi/ginkgo/v2" @@ -68,7 +68,7 @@ To suppress the wrong length check warning, add a comment with (only) 2. If the comment is before a wrong length check expression, the warning is suppressed for this expression only; for example: ```go It("should test something", func() { - // ginkgo-linter:ignore-length-warning + // ginkgo-linter:ignore-len-assert-warning Expect(len("abc")).Should(Equal(3)) // this line will not trigger the warning Expect(len("abc")).Should(Equal(3)) // this line will trigger the warning } diff --git a/ginkgo_linter.go b/ginkgo_linter.go index 5c9e0de..d7b6c93 100644 --- a/ginkgo_linter.go +++ b/ginkgo_linter.go @@ -16,7 +16,7 @@ import ( // The ginkgolinter enforces standards of using ginkgo and gomega. // // The current checks are: -// * enforce right length check - warn for assertion of len(something): +// * enforce right length assertion - warn for assertion of len(something): // // This check finds the following patterns and suggests an alternative // * Expect(len(something)).To(Equal(number)) ===> Expect(x).To(HaveLen(number)) @@ -39,15 +39,15 @@ This should be replaced with: const ( linterName = "ginkgo-linter" - wrongLengthWarningTemplate = linterName + ": wrong length check; consider using `%s` instead" + wrongLengthWarningTemplate = linterName + ": wrong length assertion; consider using `%s` instead" beEmpty = "BeEmpty" haveLen = "HaveLen" expect = "Expect" omega = "Ω" expectWithOffset = "ExpectWithOffset" - supressPrefix = "ginkgo-linter" - supressLengthCheckWarning = supressPrefix + ":ignore-length-warning" + supressPrefix = "ginkgo-linter" + supressLengthAssertionWarning = supressPrefix + ":ignore-len-assert-warning" ) // main assertion function @@ -200,7 +200,7 @@ func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Ca reverseAssertionFuncLogic(exp) exp.Args[0].(*ast.CallExpr).Fun = ast.NewIdent(beEmpty) exp.Args[0].(*ast.CallExpr).Args = nil - reportLengthCheck(pass, exp, oldExp) + reportLengthAssertion(pass, exp, oldExp) return false } else if op == `"=="` { if val == "0" { @@ -211,7 +211,7 @@ func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Ca exp.Args[0].(*ast.CallExpr).Args = []ast.Expr{valExp} } - reportLengthCheck(pass, exp, oldExp) + reportLengthAssertion(pass, exp, oldExp) return false } else if op == `"!="` { reverseAssertionFuncLogic(exp) @@ -224,7 +224,7 @@ func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Ca exp.Args[0].(*ast.CallExpr).Args = []ast.Expr{valExp} } - reportLengthCheck(pass, exp, oldExp) + reportLengthAssertion(pass, exp, oldExp) return false } } @@ -250,14 +250,14 @@ func handleEqualMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Cal exp.Args[0].(*ast.CallExpr).Fun = ast.NewIdent(haveLen) exp.Args[0].(*ast.CallExpr).Args = []ast.Expr{matcher.Args[0]} } - reportLengthCheck(pass, exp, oldExp) + reportLengthAssertion(pass, exp, oldExp) } func handleBeZero(pass *analysis.Pass, exp *ast.CallExpr, oldExp string) { exp.Args[0].(*ast.CallExpr).Args = nil exp.Args[0].(*ast.CallExpr).Fun.(*ast.Ident).Name = beEmpty - reportLengthCheck(pass, exp, oldExp) + reportLengthAssertion(pass, exp, oldExp) } func isAssertionFunc(name string) bool { @@ -268,7 +268,7 @@ func isAssertionFunc(name string) bool { return false } -func reportLengthCheck(pass *analysis.Pass, expr *ast.CallExpr, oldExpr string) { +func reportLengthAssertion(pass *analysis.Pass, expr *ast.CallExpr, oldExpr string) { replaceLenActualArg(expr.Fun.(*ast.SelectorExpr).X.(*ast.CallExpr)) newExp := goFmt(pass.Fset, expr) @@ -305,7 +305,7 @@ func isSuppressComment(commentGroup []*ast.CommentGroup) bool { comment = strings.TrimPrefix(comment, "/*") comment = strings.TrimSuffix(comment, "*/") comment = strings.TrimSpace(comment) - if comment == supressLengthCheckWarning { + if comment == supressLengthAssertionWarning { return true } } diff --git a/testdata/src/a/a.go b/testdata/src/a/a.go index 04a7083..43b2887 100644 --- a/testdata/src/a/a.go +++ b/testdata/src/a/a.go @@ -9,23 +9,23 @@ var _ = Describe("test data for the ginkgo-linter", func() { Context("test Expect", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -37,44 +37,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Expect(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -86,44 +86,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -135,44 +135,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -184,44 +184,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -233,44 +233,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Expect(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -282,44 +282,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - Expect(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -331,44 +331,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -380,44 +380,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + Expect(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -429,44 +429,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -478,46 +478,46 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) Context("test ExpectWithOffset", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(BeZero()) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -529,44 +529,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -578,44 +578,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -627,44 +627,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -676,44 +676,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(BeZero()) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -725,44 +725,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -774,44 +774,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -823,44 +823,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -872,44 +872,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -921,44 +921,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -970,46 +970,46 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) Context("test Ω", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Ω(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1021,44 +1021,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Ω(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1070,44 +1070,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1119,44 +1119,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1168,44 +1168,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1217,44 +1217,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Ω(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1266,44 +1266,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - Ω(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1315,44 +1315,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1364,44 +1364,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + Ω(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1413,44 +1413,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length check; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1462,23 +1462,23 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length check; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) diff --git a/testdata/src/a/b.go b/testdata/src/a/b.go index 5ffd824..5de7e71 100644 --- a/testdata/src/a/b.go +++ b/testdata/src/a/b.go @@ -6,11 +6,11 @@ import ( ) var _ = Describe("Supress wrong length check", func() { - Context("test ginkgo-linter:ignore-length-warning", func() { + Context("test ginkgo-linter:ignore-len-assert-warning", func() { It("should ignore length warning", func() { - // ginkgo-linter:ignore-length-warning + // ginkgo-linter:ignore-len-assert-warning Expect(len("abc")).Should(Equal(3)) - Expect(len("abc")).Should(Equal(3)) // want `ginkgo-linter: wrong length check; consider using .Expect\("abc"\)\.Should\(HaveLen\(3\)\). instead` + Expect(len("abc")).Should(Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abc"\)\.Should\(HaveLen\(3\)\). instead` Expect("123").To(HaveLen(3)) /* @@ -19,7 +19,7 @@ var _ = Describe("Supress wrong length check", func() { Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - ginkgo-linter:ignore-length-warning + ginkgo-linter:ignore-len-assert-warning Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. diff --git a/testdata/src/a/c.go b/testdata/src/a/c.go index 74fcafd..b1f2a5f 100644 --- a/testdata/src/a/c.go +++ b/testdata/src/a/c.go @@ -1,6 +1,6 @@ package a -// ginkgo-linter:ignore-length-warning +// ginkgo-linter:ignore-len-assert-warning import ( . "github.com/onsi/ginkgo/v2" diff --git a/testdata/src/a/d.go b/testdata/src/a/d.go index 5793764..3905fbc 100644 --- a/testdata/src/a/d.go +++ b/testdata/src/a/d.go @@ -6,7 +6,7 @@ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -ginkgo-linter:ignore-length-warning +ginkgo-linter:ignore-len-assert-warning Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. @@ -19,7 +19,7 @@ import ( ) var _ = Describe("test data for the ginkgo-linter", func() { - Context("test ginkgo-linter:ignore-length-warning", func() { + Context("test ginkgo-linter:ignore-len-assert-warning", func() { It("should ignore length warning", func() { Expect(len("abc")).Should(Equal(3)) Expect(len("abc")).Should(Equal(3))