forked from AuroraMiddleware/gtk
Add tests for the GtkLabel builder parser
These tests check various error conditions in GtkLabel custom tags.
This commit is contained in:
parent
87d3cc47c2
commit
2c807335c4
@ -173,6 +173,11 @@ test_ui = \
|
||||
ui/test5.ui ui/test5.expected \
|
||||
ui/test6.ui ui/test6.expected \
|
||||
ui/test7.ui ui/test7.expected \
|
||||
ui/label1.ui ui/label1.expected \
|
||||
ui/label2.ui ui/label2.expected \
|
||||
ui/label3.ui ui/label3.expected \
|
||||
ui/label4.ui ui/label4.expected \
|
||||
ui/label5.ui ui/label5.expected \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST += \
|
||||
|
1
testsuite/gtk/ui/label1.expected
Normal file
1
testsuite/gtk/ui/label1.expected
Normal file
@ -0,0 +1 @@
|
||||
SUCCESS
|
25
testsuite/gtk/ui/label1.ui
Normal file
25
testsuite/gtk/ui/label1.ui
Normal file
@ -0,0 +1,25 @@
|
||||
<!-- test all valid label attributes -->
|
||||
<interface>
|
||||
<object class="GtkLabel">
|
||||
<attributes>
|
||||
<attribute name="language" value="de" start="5" end="10"/>
|
||||
<attribute name="style" value="italic"/>
|
||||
<attribute name="weight" value="bold"/>
|
||||
<attribute name="variant" value="normal"/>
|
||||
<attribute name="stretch" value="ultra-expanded"/>
|
||||
<attribute name="underline" value="double"/>
|
||||
<attribute name="strikethrough" value="True"/>
|
||||
<attribute name="gravity" value="north"/>
|
||||
<attribute name="gravity-hint" value="line"/>
|
||||
<attribute name="family" value="sans"/>
|
||||
<attribute name="size" value="10"/>
|
||||
<attribute name="absolute-size" value="10"/>
|
||||
<attribute name="font-desc" value="Cantarell 11"/>
|
||||
<attribute name="foreground" value="yellow"/>
|
||||
<attribute name="background" value="red"/>
|
||||
<attribute name="underline-color" value="green"/>
|
||||
<attribute name="strikethrough-color" value="purple"/>
|
||||
<attribute name="scale" value="1.5"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/label2.expected
Normal file
2
testsuite/gtk/ui/label2.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: g-markup-error-quark 6
|
||||
.:5:32 element 'attribute' requires attribute 'value'
|
8
testsuite/gtk/ui/label2.ui
Normal file
8
testsuite/gtk/ui/label2.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test missing label attribute value -->
|
||||
<interface>
|
||||
<object class="GtkLabel">
|
||||
<attributes>
|
||||
<attribute name="style"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/label3.expected
Normal file
2
testsuite/gtk/ui/label3.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 6
|
||||
Could not parse enum: `warbl'
|
8
testsuite/gtk/ui/label3.ui
Normal file
8
testsuite/gtk/ui/label3.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid label attribute name -->
|
||||
<interface>
|
||||
<object class="GtkLabel">
|
||||
<attributes>
|
||||
<attribute name="warbl" value="true"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/label4.expected
Normal file
2
testsuite/gtk/ui/label4.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 1
|
||||
.:5:15 Unsupported tag for GtkContainer: <blarg>
|
8
testsuite/gtk/ui/label4.ui
Normal file
8
testsuite/gtk/ui/label4.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid tag in GtkLabel attributes -->
|
||||
<interface>
|
||||
<object class="GtkLabel">
|
||||
<attributes>
|
||||
<blarg/>
|
||||
</attributes>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/label5.expected
Normal file
2
testsuite/gtk/ui/label5.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 1
|
||||
Unhandled tag: <warbl>
|
8
testsuite/gtk/ui/label5.ui
Normal file
8
testsuite/gtk/ui/label5.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid tag in GtkLabel -->
|
||||
<interface>
|
||||
<object class="GtkLabel">
|
||||
<attributes>
|
||||
</attributes>
|
||||
<warbl/>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user