in reply to Control warnings for each module by creating new warning categories

change instances of warn to warnings::warnif, like
sub expected { warnings::warnif "ajajaj"; }

When I make that change in your example, I get the output:

enabled: no not warning!

To make this change globally, you'd just need to refactor via s/(?!warnings::)\bwarn\b/warnings::warnif/g