Consistent one-liner for receive-blocked processes
This commit is contained in:
@@ -80,16 +80,16 @@ defmodule Processes do
|
|||||||
end
|
end
|
||||||
|
|
||||||
koan "Trying to quit normally has no effect" do
|
koan "Trying to quit normally has no effect" do
|
||||||
pid = spawn(fn -> receive do
|
pid = spawn(fn -> receive do end end)
|
||||||
end
|
|
||||||
end)
|
|
||||||
Process.exit(pid, :normal)
|
Process.exit(pid, :normal)
|
||||||
|
|
||||||
assert Process.alive?(pid) == ___
|
assert Process.alive?(pid) == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "Exiting normally yourself on the other hand DOES terminate you" do
|
koan "Exiting normally yourself on the other hand DOES terminate you" do
|
||||||
pid = spawn(fn -> Process.exit(self, :normal) end)
|
pid = spawn(fn -> Process.exit(self, :normal) end)
|
||||||
:timer.sleep(100)
|
:timer.sleep(100)
|
||||||
|
|
||||||
assert Process.alive?(pid) == ___
|
assert Process.alive?(pid) == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user