Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

[tests] replace testify.Assert by assert.Assert #146

Closed
owulveryck opened this issue Oct 5, 2019 · 4 comments
Closed

[tests] replace testify.Assert by assert.Assert #146

owulveryck opened this issue Oct 5, 2019 · 4 comments
Labels
hacktoberfest Good first issue / https://hacktoberfest.digitalocean.com

Comments

@owulveryck
Copy link
Owner

In a PR, @arriven introduced https://godoc.org/gotest.tools/assert
It looks that this package has fewer dependencies than the https://github.com/stretchr/testify package that is currently used.

Less is more!

As we do not seem to use all of the power of the testify package, the project would benefit to switch to gotest.tools so it would carry fewer dependencies.

@owulveryck owulveryck added the hacktoberfest Good first issue / https://hacktoberfest.digitalocean.com label Oct 5, 2019
@enc
Copy link

enc commented Oct 5, 2019

Hi,
you are using assert.InDeltaSlice which is testify specific. Do you want to move and reimplement this with the test tools?

@owulveryck
Copy link
Owner Author

Good point!

I realize that most values are interfaces{}, and that would impose a signature:

func inDeltaSlice(a, b interface{}, precision float32) bool {}

and then playing with reflection... Do we really want to do that? I don't think so.

Or maybe, as most tests are using known values, we could use something like:

func inDeltaSliceF32(a, b []float32, precision float32) bool {}
func inDeltaSliceF64(a, b []float32, precision float32) bool {}

and to use it with

assert(t,inDeltaSliceF32(a.([]float32), b.([]float32), 1e-6),true)

Or we simply drop this issue and keep on using testify.

WDYT?

@enc
Copy link

enc commented Oct 6, 2019

In the light that the saved dependencies only affect testing and do not compile into production I wouldn't mind having a bit more comfort. While the other framework is showing good potential.

@owulveryck
Copy link
Owner Author

Agreed. I am closing this issue.
Thanks @enc for your time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hacktoberfest Good first issue / https://hacktoberfest.digitalocean.com
Projects
None yet
Development

No branches or pull requests

2 participants