diff --git a/tests/samples/variants.blp b/tests/samples/variants.blp new file mode 100644 index 0000000..a45069a --- /dev/null +++ b/tests/samples/variants.blp @@ -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); + } + } +} \ No newline at end of file diff --git a/tests/samples/variants.ui b/tests/samples/variants.ui new file mode 100644 index 0000000..4fa0a26 --- /dev/null +++ b/tests/samples/variants.ui @@ -0,0 +1,44 @@ + + + + + + true + "one" + 2 + (3, 4) + [5, 6] + {"key", <"value">} + {"GLib": "2.24", "Gtk": "4.16"} + [just "2", nothing] + + + + Test menu + + Option 1 + app.test_menu.set_action + 1 + + + Option 2 + app.test_menu.set_action + 2 + + + Option 3 + app.test_menu.set_action + 3 + + + Option 4 + app.test_menu.set_action + 4 + + + + \ No newline at end of file diff --git a/variant-test.blp b/variant-test.blp deleted file mode 100644 index 8cdca87..0000000 --- a/variant-test.blp +++ /dev/null @@ -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]); -} \ No newline at end of file