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

tests

parent 58bf84a5
Branches
No related tags found
No related merge requests found
using LabGUI
using Observables
using InteractNext
using Base.Test
##################################################
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)
@testset "Tools" begin
a[] = 3.0
@test b[] == 6.0
......@@ -33,14 +34,36 @@ d[] = 10.6
push!(d.listeners, (x) -> d.val += 1.0)
c[] = 1.0
@test d[] == 3.0
end
##################################################
print("Gridmaker:\n")
grid = make_grid(3,5)
@testset "Gridmaker" begin
@test typeof(grid) <: WebIO.Node
@test grid.children.length==3
@test grid.children[1].children.length==5
end
##################################################
gui = GUI()
wid1, graphic1 = @construct for dummy in 0:100
Node(:div, dummy)
end
wid2, graphic2 = @construct for dummybox in checkbox(false)
Node(:div, dummybox)
end
set!(gui, wid1)
set!(gui, graphic1)
add!(gui, wid2)
gui[:dummy] = 23
@testset "GUI" begin
@test typeof(gui()) <: WebIO.Node
@test obs(dummy)[] == 23
@test gui.widgets[:dummy] == dummy
end
##################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment