Skip to content

Commit

Permalink
Delete old test code
Browse files Browse the repository at this point in the history
  • Loading branch information
alfert committed Apr 28, 2015
1 parent 118e4fc commit 26da2d5
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions lib/reaxive.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,5 @@ defmodule Reaxive do
def start(_type, _args) do
Reaxive.Supervisor.start_link
end

def test_ping do
ponger = spawn(fn() -> ponger(3) end)
me = self
spawn(fn() ->
pinger(ponger)
send(me, :stop)
end)
receive do
:stop -> 1# IO.puts "Stoppped"
end
end

def pinger(ponger) do
receive do
:cancel -> 1 # IO.puts ("Canceled")
after 0 ->
send(ponger, {:ping, self})
pinger(ponger)
end

end

def ponger(0) do
receive do
{:ping, pid} ->
# IO.puts "got :ping, send :cancel"
send(pid, :cancel)
end
end
def ponger(n) do
receive do
{:ping, _pid} ->
# IO.puts "got :ping"
ponger (n-1)
end
end


def test do
alias Reaxive.Rx
tens = Rx.naturals(1) |> Rx.take(2)
mergers = [tens]
l = mergers |> Rx.merge |> Rx.to_list |> Enum.sort
# stop_tracing(file)
#if (l == [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9]),
# do: IO.puts("yeah"), else: IO.puts("ney")
end

def test_with_2 do
alias Reaxive.Rx
tens = Rx.naturals(1) |> Rx.take(10)
fives = Rx.naturals(1) |> Rx.take(5)
mergers = [tens, fives]
l = mergers |> Rx.merge |> Rx.to_list |> Enum.sort
# stop_tracing(file)
if (l == [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9]),
do: IO.puts("yeah"), else: IO.puts("ney")
end

end

0 comments on commit 26da2d5

Please sign in to comment.