Closed vatine closed 3 years ago
I had a closer look at this, and it happens with Go >= 1.14.
It stems from a formatting change in net.url.(*Error).Error()
. I think a proper fix would be to not compare the error, but instead the op and the unwrapped error, i.e.
assert.IsType(t, &url.Error{}, err)
assert.Equal(t, err.(*url.Error).Op, "parse")
assert.EqualError(t, err.(*url.Error).Unwrap(), "missing protocol scheme")
Thanks, it appears they switched the url.Error.Error() output and the unit test was fragile
Should be fixed with PR #47
Hi, as part of an occasional "look at how the Go eco-system is doing" project I occasionally poke at, I found a failing unit test. This looks like it shoudl be relatively easy to fix, and I would be happy to prepare a PR that changes the string looked for in the unit test, but I simply don't know the code base well enough to say if "fix the expected string" is the right fix, or if this is actually highlighting a problem. FWIW, it was also present in 0.5.0, but I can't speak for versions before that.