Skip to content

Conversation

@neenjaw
Copy link
Contributor

@neenjaw neenjaw commented Apr 6, 2021

When specifying a function to be called or not called you can now use :* to specify a wilcard function name. This will then match any function from a specified module;

  assert_no_call "does not call any function from List module" do
    type :informational
    called_fn module: List, name: :*
    comment "don't call List module functions"
  end

@neenjaw neenjaw mentioned this pull request Apr 6, 2021
Copy link
Member

@angelikatyborska angelikatyborska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let myself add an extra test for assert_call with the wildard. It works 👍

This will unfortunately prevent us from using assert_call with functions that are actually called *, but I can't think of any other wildcard symbol that wouldn't have this problem...

@neenjaw
Copy link
Contributor Author

neenjaw commented Apr 6, 2021

Yea, I thoguht of that, but the only one I know of is Kernel.*/2 and I hope we don't need to write a rule for that. We could use a atom enclosed in quotes too, :"*any" or some such if we wanted to be extra careful.

@angelikatyborska
Copy link
Member

Maybe name: :_ignore could serve as a wildcard? Like in the form expressions in the feature macro. But I'm also fine with keeping :*

@neenjaw
Copy link
Contributor Author

neenjaw commented Apr 6, 2021

What about just :_?

@angelikatyborska
Copy link
Member

I like that!

@neenjaw neenjaw merged commit cc85fea into main Apr 7, 2021
@neenjaw neenjaw deleted the add-wildcard branch April 7, 2021 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants