tests: Test custom types in lookup expressions

This commit is contained in:
James Westman 2022-04-30 16:13:40 -05:00
parent 76a482affb
commit cd33266452
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
11 changed files with 93 additions and 7 deletions

View file

@ -1 +1 @@
4,1,10,Gtk.Widget can't be instantiated because it's abstract
4,1,10,Gtk.Widget can't be instantiated because it's abstract

View file

@ -1,3 +1,5 @@
using Gtk 4.0;
template TestTemplate : Gtk.Orientable {}
Gtk.Orientable {}
int {}

View file

@ -1 +1,3 @@
3,25,14,Gtk.Orientable is an interface, not a class
4,1,14,Gtk.Orientable is an interface, not a class
5,1,3,int is not a class

View file

@ -0,0 +1,8 @@
using Gtk 4.0;
.MyWidget widget {}
.MyOtherWidget other_widget {
property: bind ((.MyObject) widget.something).other;
expr-prop: (.MyObject obj) => obj.other;
}

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="MyWidget" id="widget"></object>
<object class="MyOtherWidget" id="other_widget">
<binding name="property">
<lookup name="other" type="MyObject">
<lookup name="something" type="MyWidget">
<constant>widget</constant>
</lookup>
</lookup>
</binding>
<property name="expr-prop">
<lookup name="other" type="MyObject"/>
</property>
</object>
</interface>

View file

@ -137,6 +137,7 @@ class TestSamples(unittest.TestCase):
self.assert_sample("comments")
self.assert_sample("enum")
self.assert_sample("expr_closure")
self.assert_sample("expr_custom_types")
self.assert_sample("expr_lookup")
self.assert_sample("file_filter")
self.assert_sample("flags")