uber-go / dig

A reflection based dependency injection toolkit for Go.
https://go.uber.org/dig
MIT License
3.78k stars 206 forks source link

Improve visualize tests #404

Closed greeflas closed 5 months ago

greeflas commented 5 months ago

Hello!

While working on #403 I've noted that unit tests for Visualize() worked not correctly in some cases. If CreateGraph() method returns less Ctor elements than expected (and vice versa) - tests will pass.

So I fixed assert function and found new bug shown by create graph with one constructor and as interface option scenario.

JacobOaks commented 5 months ago

Hey @greeflas, CI uncovered an error running this PR. This is actually due to some incorrect testing logic written by us. Since I don't have permission to update this PR, I have created a separate PR that supersedes this one (it includes your change and fixes the broken test): https://github.com/uber-go/dig/pull/405.

Thanks for uncovering this issue!

greeflas commented 5 months ago

Ok, welcome! I'll close this PR.