google / godepq

MIT License
336 stars 32 forks source link

Handle cycles from XTestImports #16

Open timstclair opened 8 years ago

timstclair commented 8 years ago

Tests can have a different package from the package they're testing, such as with the stdlib package http / http_test (not to be confused with httptest). The most common reason for this structure is to avoid import cycles,

Currently we include both TestImpors and XTestImports when IncludeTests is set, which can cause the godepq dependency graph to have cycles. Cycles in the graph are problematic for functions like DepthLast.

dmitshur commented 8 years ago

The most common reason for this structure is to avoid import cycles,

Hmm, I thought external tests were done to make it easier to test exported APIs of packages (i.e., you can be confident that an external package doesn't accidentally rely on some private unexported functionality). I didn't realize it had much to do with import cycles.