mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
tests: add tests for signal's object attribute
This commit is contained in:
parent
4d3c2569c4
commit
492b73bc47
5 changed files with 16 additions and 2 deletions
5
tests/sample_errors/signal_object_dne.blp
Normal file
5
tests/sample_errors/signal_object_dne.blp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
using Gtk 4.0;
|
||||||
|
|
||||||
|
Button {
|
||||||
|
clicked => function(dinosaur);
|
||||||
|
}
|
1
tests/sample_errors/signal_object_dne.err
Normal file
1
tests/sample_errors/signal_object_dne.err
Normal file
|
@ -0,0 +1 @@
|
||||||
|
4,25,8,Could not find object with ID 'dinosaur'
|
|
@ -1,6 +1,10 @@
|
||||||
using Gtk 4.0;
|
using Gtk 4.0;
|
||||||
|
|
||||||
Button {
|
Entry {
|
||||||
|
activate => click(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
Button button {
|
||||||
clicked => on_button_clicked() swapped;
|
clicked => on_button_clicked() swapped;
|
||||||
notify::visible => on_button_notify_visible();
|
notify::visible => on_button_notify_visible();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk" version="4.0"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<object class="GtkButton">
|
<object class="GtkEntry">
|
||||||
|
<signal name="activate" handler="click" object="button"/>
|
||||||
|
</object>
|
||||||
|
<object class="GtkButton" id="button">
|
||||||
<signal name="clicked" handler="on_button_clicked" swapped="true"/>
|
<signal name="clicked" handler="on_button_clicked" swapped="true"/>
|
||||||
<signal name="notify::visible" handler="on_button_notify_visible"/>
|
<signal name="notify::visible" handler="on_button_notify_visible"/>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -158,6 +158,7 @@ class TestSamples(unittest.TestCase):
|
||||||
self.assert_sample_error("obj_prop_type")
|
self.assert_sample_error("obj_prop_type")
|
||||||
self.assert_sample_error("property_dne")
|
self.assert_sample_error("property_dne")
|
||||||
self.assert_sample_error("signal_dne")
|
self.assert_sample_error("signal_dne")
|
||||||
|
self.assert_sample_error("signal_object_dne")
|
||||||
self.assert_sample_error("size_group_non_widget")
|
self.assert_sample_error("size_group_non_widget")
|
||||||
self.assert_sample_error("size_group_obj_dne")
|
self.assert_sample_error("size_group_obj_dne")
|
||||||
self.assert_sample_error("styles_in_non_widget")
|
self.assert_sample_error("styles_in_non_widget")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue