diff --git a/TODO b/TODO index 4280ed8..a1742e8 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ - o iterators for array o Make use of the faster type checks FIXNUM_P. o Data members can be nullable @@ -8,6 +7,7 @@ so learn about that. o Convert Structs. + x signals x embedding example x Convert ENUMS x Vala bool type should convert to Ruby true/false diff --git a/test/test_vlib.rb b/test/test_vlib.rb index 1d80ef1..1bc08cb 100644 --- a/test/test_vlib.rb +++ b/test/test_vlib.rb @@ -84,4 +84,15 @@ def test_boolean_conversion assert_equal true, Vala::VLib.invert(false) assert_equal false, Vala::VLib.invert(true) end + + def signals + v = Vala::VLib.new + foo = nil + v.signal_connect("sig_1") do |val| + foo = val + end + assert_nil foo + v.trigger_sig_1(101) + assert_equal 101, foo + end end diff --git a/test/vlib/vlib.vala b/test/vlib/vlib.vala index b6619a9..f2dad8c 100644 --- a/test/vlib/vlib.vala +++ b/test/vlib/vlib.vala @@ -85,5 +85,11 @@ public class VLib : Object { // i += 1; // return i; // } + + public signal void sig_1(int a); + + public void trigger_sig_1(int a) { + this.sig_1(a); + } }