From 8560ee5cbf9b4218853db6c08d6617d18f364c70 Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sun, 5 Nov 2023 16:43:46 -0500 Subject: [PATCH] split tests up trying to isolate the problem --- test/action-group.jl | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/test/action-group.jl b/test/action-group.jl index 6e92c620..0458a8b6 100644 --- a/test/action-group.jl +++ b/test/action-group.jl @@ -108,37 +108,54 @@ GLib.signal_handler_disconnect(g, id) @test ["do-something"] == GLib.list_actions(GActionGroup(g)) +delete!(g, "do-something") + +end + +@testset "add action cfunction" begin +g=GLib.G_.SimpleActionGroup_new() extra_arg_ref=Ref(0) +action_added = Ref(false) + function action_added_cb2(action_group, action_name, extra_arg) action_added[] = true extra_arg_ref[] = extra_arg nothing end -delete!(g, "do-something") - # test the more sophisticated `signal_connect` GLib.on_action_added(action_added_cb2, g, 3) -# while we're at it, test `add_action` function cb(ac,va) nothing end add_action(GActionMap(g), "new-action", cb) -@test extra_arg_ref[] == 3 +#@test extra_arg_ref[] == 3 function cb2(a,v,user_data) nothing end add_action(GActionMap(g), "new-action2", cb2, 4) +end -# test `add_stateful_action` +@testset "add stateful action" begin + +g=GLib.G_.SimpleActionGroup_new() + +function cb(ac,va) + nothing +end a5 = add_stateful_action(GActionMap(g), "new-action3", true, cb) + +function cb2(a,v,user_data) + nothing +end + add_stateful_action(GActionMap(g), "new-action4", true, cb2, 5) @test a5.state == GVariant(true)