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

**URL:** <https://discourse.julialang.org/t/ann-methodinsrc-jl-verify-a-method-is-invoked-take-two/119557>\
**Category:** Package Announcements\
**Tags:** testing\
**Created:** [September 18, 2024, 3:17pm UTC](https://discourse.julialang.org/t/ann-methodinsrc-jl-verify-a-method-is-invoked-take-two/119557 "2024-09-18T15:17:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [September 18, 2024, 3:17pm UTC](https://discourse.julialang.org/t/ann-methodinsrc-jl-verify-a-method-is-invoked-take-two/119557/1 "2024-09-18T15:17:33Z")

</div>

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](https://github.com/jlapeyre/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](https://github.com/jlapeyre/IdentityMatrix.jl/blob/main/test/runtests.jl)

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.
