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

Nit: tests for pointers in structs #11

Open
Miles-Garnsey opened this issue May 27, 2022 · 2 comments
Open

Nit: tests for pointers in structs #11

Miles-Garnsey opened this issue May 27, 2022 · 2 comments

Comments

@Miles-Garnsey
Copy link
Contributor

There are tests for structs here. It might be good to see some tests for structs which contain pointer fields.

@adutra
Copy link
Owner

adutra commented May 27, 2022

Hi @Miles-Garnsey, in fact TestCoalesce is not meant to cover all possible cases extensively – if it were, it would become insanely huge.

Instead, I chose to only put a few smoke tests there.

In struct_test.go, you have many tests exercising pointer fields, see here.

I will add a comment to TestCoalesce – in fact I should have done that from the beginning.

@Miles-Garnsey
Copy link
Contributor Author

Miles-Garnsey commented May 30, 2022

Ah, I see, that does make sense.

I think it might be worth thinking about where the tests are placed, since (as well as my confusion on the struct tests) I got a bit confused over them being split between atomic_test.go and pointer_test.go and had to go hunting for some particular cases.

It might be worth thinking about having a layered approach where we move some of the existing unit tests out into integration tests (especially where the tested behaviour relies on a fallback coalescer that sits outside the unit).

I don't know if that's a task for right now though, seems like a low priority.

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

2 participants