Skip to content

Commit

Permalink
rename Input to Signal in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Nov 15, 2015
1 parent acffeb1 commit eecba8a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/async.jl
Expand Up @@ -2,7 +2,7 @@
facts("Async") do

context("async_map") do
x = Input(1)
x = Signal(1)
t, y = async_map(-, 0, x)

@fact value(t) --> nothing
Expand Down
24 changes: 12 additions & 12 deletions test/basics.jl
Expand Up @@ -10,7 +10,7 @@ number() = round(Int, rand()*1000)

facts("Basic checks") do

a = Input(number())
a = Signal(number())
b = map(x -> x*x, a)

context("map") do
Expand Down Expand Up @@ -53,7 +53,7 @@ facts("Basic checks") do
context("merge") do

## Merge
d = Input(number())
d = Signal(number())
e = merge(d, b, a)

# precedence to d
Expand Down Expand Up @@ -85,7 +85,7 @@ facts("Basic checks") do

context("filter") do
# filter
g = Input(0)
g = Signal(0)
pred = x -> x % 2 != 0
h = filter(pred, 1, g)
j = filter(x -> x % 2 == 0, 1, g)
Expand All @@ -104,11 +104,11 @@ facts("Basic checks") do

context("sampleon") do
# sampleon
g = Input(0)
g = Signal(0)

push!(g, number())
step()
i = Input(true)
i = Signal(true)
j = sampleon(i, g)
# default value
@fact value(j) --> value(g)
Expand All @@ -124,7 +124,7 @@ facts("Basic checks") do
# droprepeats
count = s -> foldp((x, y) -> x+1, 0, s)

k = Input(1)
k = Signal(1)
l = droprepeats(k)

@fact value(l) --> value(k)
Expand All @@ -148,8 +148,8 @@ facts("Basic checks") do

context("filterwhen") do
# filterwhen
b = Input(false)
n = Input(1)
b = Signal(false)
n = Signal(1)
dw = filterwhen(b, 0, n)
@fact value(dw) --> 0
push!(n, 2)
Expand All @@ -169,8 +169,8 @@ facts("Basic checks") do
end

context("push! inside push!") do
a = Input(0)
b = Input(1)
a = Signal(0)
b = Signal(1)
map(x -> push!(a, x), b)

@fact value(a) --> 0
Expand All @@ -193,7 +193,7 @@ facts("Basic checks") do
end

context("previous") do
x = Input(0)
x = Signal(0)
y = previous(x)
@fact value(y) --> 0

Expand All @@ -216,7 +216,7 @@ facts("Basic checks") do


context("delay") do
x = Input(0)
x = Signal(0)
y = delay(x)
@fact value(y) --> 0

Expand Down
4 changes: 2 additions & 2 deletions test/call_count.jl
Expand Up @@ -2,8 +2,8 @@
number() = rand(0:100)

facts("Call counting") do
a = Input(0)
b = Input(0)
a = Signal(0)
b = Signal(0)

c = map(+, a, b)
d = merge(a, b)
Expand Down
6 changes: 3 additions & 3 deletions test/flatten.jl
Expand Up @@ -3,10 +3,10 @@ using Reactive

facts("Flatten") do

a = Input(0)
b = Input(1)
a = Signal(0)
b = Signal(1)

c = Input(a)
c = Signal(a)

d = flatten(c)
cnt = foldp((x, y) -> x+1, 0, d)
Expand Down
4 changes: 2 additions & 2 deletions test/time.jl
Expand Up @@ -2,7 +2,7 @@
facts("Timing functions") do

context("fpswhen") do
b = Input(false)
b = Signal(false)
t = fpswhen(b, 10)
acc = foldp((x, y) -> x+1, 0, t)
sleep(0.14)
Expand Down Expand Up @@ -67,7 +67,7 @@ facts("Timing functions") do
end

context("throttle") do
x = Input(0)
x = Signal(0)
y = throttle(0.1, x)
y′ = throttle(0.2, x, push!, Int[], x->Int[]) # collect intermediate updates
z = foldp((acc, x) -> acc+1, 0, y)
Expand Down

0 comments on commit eecba8a

Please sign in to comment.