11# # Tests
2+ using Test
23
34using Gtk. ShortNames, Gtk. GConstants, Gtk. Graphics
45import Gtk. deleteat!, Gtk. libgtk_version, Gtk. GtkToolbarStyle, Gtk. GtkFileChooserAction, Gtk. GtkResponseType
@@ -195,6 +196,8 @@ push!(w, pw)
195196push! (pw, Button (" one" ))
196197push! (pw, pw2)
197198@test pw[2 ]== pw2
199+ @test length (pw) == 2
200+ @test eachindex (pw) == 1 : 2
198201pw2[1 ]= Button (" two" )
199202pw2[2 ,true ,false ]= Button (" three" )
200203showall (w)
@@ -207,6 +210,7 @@ l = Layout(600,600)
207210push! (w,l)
208211l[300 ,300 ]= Button (" Button" )
209212s= size (l)
213+ @test s == (600 , 600 )
210214@test width (l)== 600
211215@test height (l)== 600
212216showall (w)
@@ -224,6 +228,8 @@ g2 = Gtk.GtkBox(:h)
224228push! (f,g1)
225229push! (f,g2)
226230@test f[1 ]== g1
231+ @test length (f) == 2
232+ @test eachindex (f) == 1 : 2
227233
228234b11 = Button (" first" )
229235push! (g1, b11)
281287 grid[2 ,3 ] = Button (" 2,3" )
282288 grid[1 ,1 ] = " grid"
283289 grid[3 ,1 : 3 ] = Button (" Tall button" )
290+ @test_broken eachindex (grid) == CartesianIndices (size (grid))
284291 insert! (grid,1 ,:top )
285292 insert! (grid,3 ,:bottom )
286293 insert! (grid,grid[1 ,2 ],:right )
@@ -499,11 +506,13 @@ for c in choices
499506 push! (combo, c)
500507end
501508c = cells (CellLayout (combo))
509+ @test eachindex (c) == 1 : 1
502510set_gtk_property! (c[1 ]," max_width_chars" , 5 )
503511
504512w = Window (combo, " ComboGtkBoxText" )|> showall
505513lsl = ListStoreLeaf (combo)
506514@test length (lsl) == 3
515+ @test eachindex (lsl) == CartesianIndices (size (lsl))
507516empty! (combo)
508517@test length (lsl) == 0
509518
@@ -718,6 +727,8 @@ push!(ls,(33,true))
718727pushfirst! (ls,(22 ,false ))
719728popfirst! (ls)
720729@test size (ls)== (2 ,2 )
730+ @test eachindex (ls) == CartesianIndices (size (ls))
731+ @test axes (ls, 1 ) == axes (ls, 2 ) == 1 : 2
721732insert! (ls, 2 , (35 , false ))
722733tv= TreeView (TreeModel (ls))
723734r1= CellRendererText ()
@@ -796,6 +807,7 @@ push!(toolbar,tb3)
796807push! (toolbar,SeparatorToolItem (), ToggleToolButton (" gtk-open" ), MenuToolButton (" gtk-new" ))
797808@test toolbar[0 ]== tb2 # FIXME : uses zero based indexing
798809@test length (toolbar)== 6
810+ @test eachindex (toolbar) == 0 : 5 # FIXME zero-based indexing
799811G_. style (toolbar,GtkToolbarStyle. BOTH)
800812w = Window (toolbar, " Toolbar" )|> showall
801813destroy (w)
0 commit comments