mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
tests: Test custom types in lookup expressions
This commit is contained in:
parent
c7c32cbb4a
commit
52f7d790bd
10 changed files with 82 additions and 14 deletions
|
@ -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
|
|
@ -1,3 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template TestTemplate : Gtk.Orientable {}
|
||||
Gtk.Orientable {}
|
||||
int {}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
3,29,10,Gtk.Orientable is not a class
|
||||
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
|
8
tests/samples/expr_custom_types.blp
Normal file
8
tests/samples/expr_custom_types.blp
Normal 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;
|
||||
}
|
17
tests/samples/expr_custom_types.ui
Normal file
17
tests/samples/expr_custom_types.ui
Normal 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>
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue