mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
move variants into testing
This commit is contained in:
parent
96c5760eaf
commit
c708532a8d
3 changed files with 86 additions and 16 deletions
42
tests/samples/variants.blp
Normal file
42
tests/samples/variants.blp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
using Gtk 4.0;
|
||||||
|
|
||||||
|
$BlueprintTestObject {
|
||||||
|
// test-one: variant<"s">("one");
|
||||||
|
test-zero: variant<"b">(true);
|
||||||
|
test-one: variant<"s">("one");
|
||||||
|
test-two: variant<"i">(2);
|
||||||
|
test-three: variant<"(ii)">((3, 4));
|
||||||
|
test-four: variant<"ai">([5, 6]);
|
||||||
|
test-five: variant<"{sv}">({"key", <"value">});
|
||||||
|
test-six: variant<"a{ss}">({
|
||||||
|
"GLib": "2.24",
|
||||||
|
"Gtk": "4.16"
|
||||||
|
});
|
||||||
|
test-seven: variant<"ams">([just "2", nothing]);
|
||||||
|
}
|
||||||
|
|
||||||
|
menu test_menu {
|
||||||
|
submenu {
|
||||||
|
label: "Test menu";
|
||||||
|
item {
|
||||||
|
label: "Option 1";
|
||||||
|
action: "app.test_menu.set_action";
|
||||||
|
target: variant<"y">(1);
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
label: "Option 2";
|
||||||
|
action: "app.test_menu.set_action";
|
||||||
|
target: variant<"y">(2);
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
label: "Option 3";
|
||||||
|
action: "app.test_menu.set_action";
|
||||||
|
target: variant<"y">(3);
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
label: "Option 4";
|
||||||
|
action: "app.test_menu.set_action";
|
||||||
|
target: variant<"y">(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
44
tests/samples/variants.ui
Normal file
44
tests/samples/variants.ui
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
DO NOT EDIT!
|
||||||
|
This file was @generated by blueprint-compiler. Instead, edit the
|
||||||
|
corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||||
|
-->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk" version="4.0"/>
|
||||||
|
<object class="BlueprintTestObject">
|
||||||
|
<property name="test-zero" type="b">true</property>
|
||||||
|
<property name="test-one" type="s">"one"</property>
|
||||||
|
<property name="test-two" type="i">2</property>
|
||||||
|
<property name="test-three" type="(ii)">(3, 4)</property>
|
||||||
|
<property name="test-four" type="ai">[5, 6]</property>
|
||||||
|
<property name="test-five" type="{sv}">{"key", <"value">}</property>
|
||||||
|
<property name="test-six" type="a{ss}">{"GLib": "2.24", "Gtk": "4.16"}</property>
|
||||||
|
<property name="test-seven" type="ams">[just "2", nothing]</property>
|
||||||
|
</object>
|
||||||
|
<menu id="test_menu">
|
||||||
|
<submenu>
|
||||||
|
<attribute name="label">Test menu</attribute>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Option 1</attribute>
|
||||||
|
<attribute name="action">app.test_menu.set_action</attribute>
|
||||||
|
<attribute name="target" type="y">1</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Option 2</attribute>
|
||||||
|
<attribute name="action">app.test_menu.set_action</attribute>
|
||||||
|
<attribute name="target" type="y">2</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Option 3</attribute>
|
||||||
|
<attribute name="action">app.test_menu.set_action</attribute>
|
||||||
|
<attribute name="target" type="y">3</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Option 4</attribute>
|
||||||
|
<attribute name="action">app.test_menu.set_action</attribute>
|
||||||
|
<attribute name="target" type="y">4</attribute>
|
||||||
|
</item>
|
||||||
|
</submenu>
|
||||||
|
</menu>
|
||||||
|
</interface>
|
|
@ -1,16 +0,0 @@
|
||||||
using Gtk 4.0;
|
|
||||||
|
|
||||||
$BlueprintTestObject {
|
|
||||||
// test-one: variant<"s">("one");
|
|
||||||
test-zero: variant<"b">(true);
|
|
||||||
test-one: variant<"s">("one");
|
|
||||||
test-two: variant<"i">(2);
|
|
||||||
test-three: variant<"(ii)">((3, 4));
|
|
||||||
test-four: variant<"ai">([5, 6]);
|
|
||||||
test-five: variant<"{sv}">({"key", <"value">});
|
|
||||||
test-six: variant<"a{ss}">({
|
|
||||||
"GLib": "2.24",
|
|
||||||
"Gtk": "4.16"
|
|
||||||
});
|
|
||||||
test-seven: variant<"ams">([just "2", nothing]);
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue