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

it.Fail(...)..Contain(...) does not return actual value #15

Open
fogfish opened this issue Jul 18, 2023 · 0 comments
Open

it.Fail(...)..Contain(...) does not return actual value #15

fogfish opened this issue Jul 18, 2023 · 0 comments
Labels

Comments

@fogfish
Copy link
Owner

fogfish commented Jul 18, 2023

t.Run("Corrupted", func(t *testing.T) {
		it.Then(t).Should(
			it.Fail(
				func() error {
					return json.Unmarshal([]byte(geometryCorrupted), geo)
				},
			).Contain("type Unknown is not supported as GeoJSON Point"),
		)
	})

fails with

--- FAIL: TestGeometryPoint (0.00s)
    --- FAIL: TestGeometryPoint/Corrupted (0.00s)
        geometry_test.go:185: should github.com/fogfish/geojson_test.TestGeometryPoint.func3.1 return error contain type Unknown is not supported as GeoJSON Point

it is expected that actual error value is returned

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

No branches or pull requests

1 participant