Add some tests for new GtkBuilder syntax

Some valid and invalid examples for <closure>,
<lookup> and <constant>.
This commit is contained in:
Matthias Clasen 2019-12-18 17:34:38 -05:00
parent 9c849d2084
commit fc9462d49e
16 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="gchararray">bla</constant>
</property>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
Could not parse integer 'bla'

View File

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="gint">bla</constant>
</property>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 13
.:0:0 Object with ID bla not found

View File

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant>bla</constant>
</property>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
.:4:36 Invalid type 'nosuchtype'

View File

@ -0,0 +1,7 @@
<interface>
<object class="GtkDropDown">
<property name="expression">
<constant type="nosuchtype">bla</constant>
</property>
</object>
</interface>

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,8 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label">bla</lookup>
</property>
</object>
</interface>

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,8 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label" type="GtkLabel">bla</lookup>
</property>
</object>
</interface>

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,10 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<lookup name="label">
<constant type="GtkLabel">bla</constant>
</lookup>
</property>
</object>
</interface>

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,11 @@
<interface>
<object class="GtkLabel" id="bla"/>
<object class="GtkDropDown">
<property name="expression">
<closure type='gchararray' function="strcmp">
<constant type="gchararray">File size:</constant>
<lookup type="GtkLabel" name="max-width-chars">bla</lookup>
</closure>
</property>
</object>
</interface>