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

Fix visualize tests #405

Closed JacobOaks closed 5 months ago

JacobOaks commented 5 months ago

PR #404 attempted to improve the tests in visualize_test.go by requiring length equality on the expected/actual ctors.

During CI, this actually uncovered a test failure:

--- FAIL: TestDotGraph (0.02s)
    --- FAIL: TestDotGraph/create_graph_with_one_constructor_and_as_interface_option (0.00s)
        visualize_test.go:453:
                Error Trace:    visualize_test.go:453
                                            visualize_test.go:117
                Error:          "[]" should have 1 item(s), but has 0
                Test:           TestDotGraph/create_graph_with_one_constructor_and_as_interface_option

This is because in this specific test case, the provide was never actually successful because of an error during provide (t5 did not implement io.Reader).

This commit:

This supercedes #404.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (45369ac) 98.40% compared to head (dff4fbd) 98.40%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #405 +/- ## ======================================= Coverage 98.40% 98.40% ======================================= Files 22 22 Lines 1507 1507 ======================================= Hits 1483 1483 Misses 15 15 Partials 9 9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.