The warning is a bug. "assert_receive(message, 100)" should be valid.
Please open up a bug report.



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Thu, Aug 3, 2017 at 12:02 PM, <[email protected]> wrote:

>
> Hi all!
>
> I often watch to check if message is received in tests and then only do
> comparison.
>
> assert_receive(^result, 1000, "msg")
>
> and
>
> assert_receive(result, 1000, "msg")
> assert result == correct_data
>
> are totally different. Because first one makes selective receive and
> provides less readable matching diff, actually.
>
> And in second case I want to check that message is received in specified
> timerange and then have nice diff.
>
> The problem:
>
> - in second case compiler complains that match will always happen (which
> is true)
>
> Proposal:
>
> - change assert_receive to determine that there is no pinned variables in
> first argument and just make sure that any message is received?
> - create separate assert_XXXX function that handles just that
>
> Do you think it is useful? Any other ideas how this scenario can be
> implemented? Am I doing something totally wrong? :)
>
> /Gaspar
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/e018244f-4ff0-41a6-8d24-
> fb4976dfb6de%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/e018244f-4ff0-41a6-8d24-fb4976dfb6de%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JswCS5Za2Ce0n-eEtsAfasay4tbyZ1WpFkEY%3Du3qMKpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to