Consistent one-liner for receive-blocked processes

This commit is contained in:
Jay Hayes
2016-05-02 19:23:10 -05:00
parent 1611483206
commit b2458bb472

View File

@@ -80,16 +80,16 @@ defmodule Processes do
end
koan "Trying to quit normally has no effect" do
pid = spawn(fn -> receive do
end
end)
pid = spawn(fn -> receive do end end)
Process.exit(pid, :normal)
assert Process.alive?(pid) == ___
end
koan "Exiting normally yourself on the other hand DOES terminate you" do
pid = spawn(fn -> Process.exit(self, :normal) end)
:timer.sleep(100)
assert Process.alive?(pid) == ___
end