Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convey.So bug report: errors.New() compares with nil return wrong result #666

Open
LugeKit opened this issue Aug 24, 2022 · 0 comments
Open

Comments

@LugeKit
Copy link

LugeKit commented Aug 24, 2022

Version: v1.7.2
ApplyFunc use github.com/agiledragon/gomonkey/v2 v2.1.0

Code:

func Test(t *testing.T) {
	Convey("Test", t, func() {
		defer ApplyFunc(json.Marshal, func(v interface{}) ([]byte, error) {
			return nil, errors.New("test shouldNotEqual")
		}).Reset()

		_, err := json.Marshal("")
		So(err, ShouldNotEqual, nil)
	})
}

Result:

Failures:
  Line 97:
  Expected     'test shouldNotEqual'
  to NOT equal '<nil>'
  (but it did)!


1 total assertion

--- FAIL: Test (0.00s)

FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant