-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix several allowances with same keys #6
Fix several allowances with same keys #6
Conversation
test/nimble_ownership_test.exs
Outdated
end) | ||
|
||
send(parent_pid, :done) | ||
f.(f).() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for doing recursion, but it's gonna be clearer to use a separate private function. Also, do you actually need to receive multiple times here, or just twice? You could do:
for _ <- 1..2 do
receive ...
end
to avoid the recursion altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for _ <- 1..2 do
receive ...
end
What have I used instead of a brain for my whole life?! :)
Thanks, of course, pushed.
Fantastic catch, thanks @am-kantox 💟 |
Released v0.3.2. |
Would you want me to backport it to Mox |
FWIW, feel free to cherry-pick it from https://github.com/dashbitco/mox/compare/v1.1.0...am-kantox:mox:fix_several_allowances_merging?expand=1 (I cannot make a PR to a tag.) |
@am-kantox we might do a Mox release but for now you should be able to just |
@whatyouhide |
Aaaaah I didn't get that this issue is there in Mox as well. @josevalim should we just make a Mox release that uses nimble_ownership then? |
Yeah, it is probably time for a minor ownership release! |
Not that I was nudging anyone, this is just a kind reminder that if we finally had |
In
mox
(including but not limited to the latest version,) when one adds several deferred mocks to the list of allowed processes, this results in the followingallowances
passed to the privatefix_resolved/2
and gets effectively ruined by
Map.new/1
intoThis PR provides a proper map construction from a proplist above by merging maps.
The test could have been done better, please guide me if you want it to be prettified.
Thanks!