summaryrefslogtreecommitdiff
path: root/tests/basic-types
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-02-23 20:19:31 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-02-23 20:19:31 +0100
commit339776721db26b897a85f0f9052e708fd2a919ba (patch)
treeef3bfc54bb5a9ea60b834e7bf36af3891968996f /tests/basic-types
parent4e4ce22bdf93ec3ba3f12cc74b1fa2af66e32404 (diff)
downloadvala-339776721db26b897a85f0f9052e708fd2a919ba.tar.gz
tests: Add "struct in array" test to increase coverage
Diffstat (limited to 'tests/basic-types')
-rw-r--r--tests/basic-types/arrays.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basic-types/arrays.vala b/tests/basic-types/arrays.vala
index cbbdc6ef0..174e5d472 100644
--- a/tests/basic-types/arrays.vala
+++ b/tests/basic-types/arrays.vala
@@ -263,8 +263,17 @@ const Foo[] FOO_ARRAY_CONST = {
{ { "foo", "bar" }, 42 },
};
+struct Bar {
+ public int bar;
+}
+
void test_struct_array () {
assert (FOO_ARRAY_CONST[0].bar == 42);
+
+ Bar b = { 4711 };
+ var bar = new Bar[23];
+ bar[7] = b;
+ assert (b in bar);
}
void give_fixed_array (out int i[3]) {