Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (22 sloc) 613 Bytes
defmodule ClocksTest do
use ExUnit.Case
doctest Clocks
test "greets the world" do
sentence = "hello my friend how are you"
String.split(sentence)
|> Enum.map(fn word -> Dispatcher.send_word(word) end)
|> Enum.each(fn task -> Task.await(task) end)
Eventually.assertUntil 100, 5, fn() ->
same_history =
Dispatcher.get_workers()
|> Enum.map(fn w -> Worker.get_history(w) end)
|> all_equal
assert same_history == true
end
end
def all_equal([x | xs]) do
IO.inspect x
Enum.map(xs, fn y -> y == x end)
|> Enum.all?
end
end
You can’t perform that action at this time.