Closed mccalluc closed 2 weeks ago
This is most of it:
$ egrep 'cfg.*test' -r src -A 1 | grep 'mod.rs' | grep -v cfg | grep -v 'mod test;' | wc -l
9
$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ egrep 'cfg.*test' -r src -A 1 | grep 'mod.rs' | grep -v cfg | grep -v 'mod test;' | wc -l
63
mod.rs
files (with the exception of error.rs
which I happened to do first). If we carry it through to all files, then it's effectively saying that every file should be mod.rs
in its own directory, and that might be too much of a good thing.test
, although that causes some problems: there are some public modules with utilities, that are then *
imported, and we would now have name conflicts.[cfg(test)]
blocks with different sets of extra features. For now, I've just moved one over to test.rs
.Since this touches so many files, it's likely to pick up merge conflicts ... but conversely, it might introduce merge conflicts in other PRs which are higher priority.
With tests in separate files, they code they test won't need to be rebuilt as often.
Draft