Skip to content

Conversation

@andremaker
Copy link
Contributor

@andremaker andremaker commented Sep 3, 2025

These macros are missing an explicit mention of the fact that they remove the first match, which is an important piece of behavior in the documentation.

This behavior detail is often learned indirectly for receive/1, since most explanations also mention that a matching message is removed from the mailbox. Still, making it explicit in the docs avoids ambiguity.

For assert_receive/3 and assert_received/2, the removal is a hidden side effect that may not be noticed, since the focus is on assertion semantics. Calling it out in the docs prevents confusion and makes the behavior clearer.

@andremaker andremaker changed the title doc: mention receive/1 and ExUnit.Assertions.assert_receive/4 removes messages doc: mention that receive/1 and ExUnit.Assertions.assert_receive/4 removes messages Sep 3, 2025
@josevalim josevalim merged commit a5bdf8a into elixir-lang:main Sep 3, 2025
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants