hlissner/emacs-solaire-mode

Test files should not provide features

tarsius opened this issue · 2 comments

Test files should not provide a feature. Providing a feature is only suitable for libraries that are loaded by other libraries/packages or by the end user using require. For require to be able to do its job, the library that provides the feature has to be located on the load-path, but test files should not be located on the load-path.

You are probably already loading this test file using something like (load "relative/path/to/it") and can just remove the provide form. If not, then you probably just have to replace a require with a such a load form somewhere.

One reason why test files should not provide a feature and/or reside on the load-path is that authors tend to name those files just tests.el or something like that. If only one package does that, then that works, but it only takes two out of several thousands and things start to get problematic. In fact I usually don't notice such issues until there actually are two packages that provide the exact same "testing feature".

I have written similar messages many many times so I now use a template. I try to adjust it to match each individual case but it might still not apply 100% in all cases.

You might also want to check if the test file should really require solaire-mode-autoloads in addition to solaire-mode.

Good points! I've removed the provide and unnecessary require in my test file. Thanks for letting me know!