Add tests for middleware._excludesAny() core function