Add tests for the infobar builder parser

This commit is contained in:
Matthias Clasen 2015-04-26 23:03:05 -04:00
parent 2dc8673a41
commit 8ae4a82ae4
11 changed files with 75 additions and 0 deletions

View File

@ -214,6 +214,11 @@ test_ui = \
ui/filefilter8.ui ui/filefilter8.expected \
ui/filefilter9.ui ui/filefilter9.expected \
ui/filefilter10.ui ui/filefilter10.expected \
ui/infobar1.ui ui/infobar1.expected \
ui/infobar2.ui ui/infobar2.expected \
ui/infobar3.ui ui/infobar3.expected \
ui/infobar4.ui ui/infobar4.expected \
ui/infobar5.ui ui/infobar5.expected \
$(NULL)
EXTRA_DIST += \

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,17 @@
<!-- test all valid infobar markup -->
<interface>
<object class="GtkInfoBar">
<child>
<object class="GtkButton" id="button_cancel"/>
</child>
<child>
<object class="GtkButton" id="button_ok">
<property name="can-default">True</property>
</object>
</child>
<action-widgets>
<action-widget response="-3">button_cancel</action-widget>
<action-widget response="ok">button_ok</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
.:8:38 Could not parse enum: `xyz'

View File

@ -0,0 +1,11 @@
<!-- invalid response value -->
<interface>
<object class="GtkInfoBar">
<child>
<object class="GtkButton" id="button_cancel"/>
</child>
<action-widgets>
<action-widget response="xyz">button_cancel</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 4
.:8:48 attribute 'food' invalid for element 'action-widget'

View File

@ -0,0 +1,11 @@
<!-- invalid attribute -->
<interface>
<object class="GtkInfoBar">
<child>
<object class="GtkButton" id="button_cancel"/>
</child>
<action-widgets>
<action-widget response="ok" food="egg">button_cancel</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
.:8:15 Unsupported tag for GtkInfoBar: <worbl>

View File

@ -0,0 +1,11 @@
<!-- invalid element -->
<interface>
<object class="GtkInfoBar">
<child>
<object class="GtkButton" id="button_cancel"/>
</child>
<action-widgets>
<worbl/>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
Unhandled tag: <worbl>

View File

@ -0,0 +1,11 @@
<!-- invalid element -->
<interface>
<object class="GtkInfoBar">
<child>
<object class="GtkButton" id="button_cancel"/>
</child>
<action-widgets>
</action-widgets>
<worbl/>
</object>
</interface>