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

InEpsilon has inconsistent results with expected or actual values of Inf #1662

Open
brackendawson opened this issue Oct 16, 2024 · 0 comments · May be fixed by #1663
Open

InEpsilon has inconsistent results with expected or actual values of Inf #1662

brackendawson opened this issue Oct 16, 2024 · 0 comments · May be fixed by #1663

Comments

@brackendawson
Copy link
Collaborator

func TestInEpsilon1(t *testing.T) {
	div := 0.0
	require.InEpsilon(t, 1, 1/div, 0.001)
}

func TestInEpsilon2(t *testing.T) {
	div := 0.0
	require.InEpsilon(t, 1/div, 1, 0.001)
}
> go test -v -run InEps | grep -E '(PASS|FAIL)'
--- FAIL: TestInEpsilon1 (0.00s)
--- PASS: TestInEpsilon2 (0.00s)

Originally posted by @ybrustin-te in #918 (comment)

Given the difference between two Inf values cannot be determined, those assertions should both fail.

ybrustin added a commit to ybrustin/testify that referenced this issue Oct 16, 2024
@ybrustin ybrustin linked a pull request Oct 16, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant