Skip to content
Snippets Groups Projects
Commit 58bf84a5 authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

some tests

parent a46c1037
No related branches found
No related tags found
No related merge requests found
using LabGUI
using Observables
using Base.Test
# write your own tests here
@test 1 == 2
##################################################
print("Tools:\n")
a = Observables.Observable(5.0)
b = Observables.Observable(5.0)
f(x) = 2*x
g(x) = x/2
link!(a,b, f, g)
a[] = 3.0
@test b[] == 6.0
b[] = 10.6
@test a[] == 5.3
push!(b.listeners, (x) -> b.val += 1.0)
a[] = 1.0
@test b[] == 2.0
c = Observables.Observable(5.0)
d = Observables.Observable(5.0)
link!(c,d, f, g, true)
c[] = 3.0
@test d[] == 6.0
d[] = 10.6
@test c[] == 5.3
push!(d.listeners, (x) -> d.val += 1.0)
c[] = 1.0
@test d[] == 3.0
##################################################
print("Gridmaker:\n")
grid = make_grid(3,5)
@test typeof(grid) <: WebIO.Node
@test grid.children.length==3
@test grid.children[1].children.length==5
##################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment