From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- test cases/vala/18 vapi consumed twice/app.vala | 11 +++++++++++ test cases/vala/18 vapi consumed twice/beer.vala | 10 ++++++++++ test cases/vala/18 vapi consumed twice/meson.build | 15 +++++++++++++++ test cases/vala/18 vapi consumed twice/person.vala | 16 ++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 test cases/vala/18 vapi consumed twice/app.vala create mode 100644 test cases/vala/18 vapi consumed twice/beer.vala create mode 100644 test cases/vala/18 vapi consumed twice/meson.build create mode 100644 test cases/vala/18 vapi consumed twice/person.vala (limited to 'test cases/vala/18 vapi consumed twice') diff --git a/test cases/vala/18 vapi consumed twice/app.vala b/test cases/vala/18 vapi consumed twice/app.vala new file mode 100644 index 0000000..cd94a42 --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/app.vala @@ -0,0 +1,11 @@ +namespace App { + public static int main(string[] args) { + var person = new Person(); + print("Favorite beer of \"%s\" is %s\n", person.name, person.favorite_beer.flavor); + + var beer = new Beer("tasty"); + print("This beer is %s\n", beer.flavor); + + return 0; + } +} diff --git a/test cases/vala/18 vapi consumed twice/beer.vala b/test cases/vala/18 vapi consumed twice/beer.vala new file mode 100644 index 0000000..cee38ad --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/beer.vala @@ -0,0 +1,10 @@ +public class Beer : Object { + public string flavor { + get; + construct; + } + + public Beer(string flavor) { + Object(flavor: flavor); + } +} diff --git a/test cases/vala/18 vapi consumed twice/meson.build b/test cases/vala/18 vapi consumed twice/meson.build new file mode 100644 index 0000000..6a7f5eb --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/meson.build @@ -0,0 +1,15 @@ +project('vapi consumed twice', 'vala', 'c') + +base_deps = [dependency('glib-2.0'), dependency('gobject-2.0')] + +beer = library('beer', 'beer.vala', dependencies : base_deps) +beer_dep = declare_dependency(link_with : beer) + +person = library('person', 'person.vala', link_with : beer, + dependencies : base_deps) +person_dep = declare_dependency(link_with : person, dependencies : [beer_dep]) + +app = executable('app', 'app.vala', + dependencies : base_deps + [person_dep, beer_dep]) + +test('valavapiconsumedtwicetest', app) diff --git a/test cases/vala/18 vapi consumed twice/person.vala b/test cases/vala/18 vapi consumed twice/person.vala new file mode 100644 index 0000000..36b0025 --- /dev/null +++ b/test cases/vala/18 vapi consumed twice/person.vala @@ -0,0 +1,16 @@ +public class Person : Object { + public string name { + get { + return "Joe Badger"; + } + } + + public Beer favorite_beer { + get; + construct; + } + + public Person() { + Object(favorite_beer: new Beer("smooth")); + } +} -- cgit v1.2.3