Please mention the refute_receive one on the same report.


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

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

> What about
>
> refute_receive(msg, 100, "got message")
>
> Should it just fail compiling? Because it does not make any sense. Either
> variable should be pinned or it should be _ in there.
>
> Separate bug report?
>
>
>
> On Thursday, August 3, 2017 at 1:53:27 PM UTC+3, José Valim wrote:
>>
>> 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/ms
>>> gid/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/CAGnRm4Jg3Qe3KFessqY%3DQpSiNO_hK8kbka1-3wSQkHHz-ufJVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to