ANN: MethodInSrc.jl ; verify a method is invoked: Take two

A couple of times, when testing a package, I realized that although I thought a call was dispatching to a method in the package, it was actually dispatching to a fall-back method in Base.

So I wrote macros to test that a call dispatches to the method in your package. These are collected in MethodInSrc.jl. See the README for more details.

I announced this package six years ago. It was either never registered, or was purged. It never had a Project.toml till a couple of days ago. I am announcing again because it is now in the General registry.

Examples of use in an unregistered package is here IdentityMatrix.jl/test/runtests.jl at main · jlapeyre/IdentityMatrix.jl · GitHub

If I recall correctly, when preparing to register the package, the code from six years ago worked without modification. This is because it uses InteractiveUtils, which has been stable.

2 Likes