Closed EB-Plum closed 2 years ago
https://hexdocs.pm/ex_unit/1.13/ExUnit.Assertions.html#assert_receive/3
according to doc, it seems assert_receive
is not considering message order.
it only checks if message was delivered or not.
just in case, if anyone like me want to see the queue. try code below.
koan "Received messages are queued, first in first out" do
send(self(), "hola!")
send(self(), "como se llama?")
{:messages, queue } = Process.info(self(), :messages)
assert Enum.at(queue, 0) == ___
assert Enum.at(queue, 1) == ___
end
👀 #276
https://github.com/elixirkoans/elixir-koans/blob/f5e3f75448e9a44bb3445d670f65ed37a216c792/lib/koans/15_processes.ex#L62-L68
i tried wrong answer(?), but somehow it passed. is this just my fault? or
assert_receive
acting weird?