--
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 elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/e018244f-4ff0-41a6-8d24-fb4976dfb6de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The warning is a bug. "assert_receive(message, 100)" should be valid. Please open up a bug report.
On Thu, Aug 3, 2017 at 12:02 PM, <gasp...@gmail.com> wrote:
Hi all!I often watch to check if message is received in tests and then only do comparison.assert_receive(^result, 1000, "msg")andassert_receive(result, 1000, "msg")assert result == correct_dataare 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 thatDo 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 elixir-lang-co...@googlegroups.com.
The warning is a bug. "assert_receive(message, 100)" should be valid. Please open up a bug report.
On Thu, Aug 3, 2017 at 12:02 PM, <gasp...@gmail.com> wrote:
Hi all!I often watch to check if message is received in tests and then only do comparison.assert_receive(^result, 1000, "msg")andassert_receive(result, 1000, "msg")assert result == correct_dataare 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 thatDo 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 elixir-lang-co...@googlegroups.com.