summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/arrays/inline-struct.vala18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b224eb437..c604b2887 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -93,6 +93,7 @@ TESTS = \
arrays/inline-local-instantiation.test \
arrays/inline-local-variable.test \
arrays/inline-parameter.test \
+ arrays/inline-struct.vala \
arrays/inline-struct-field.test \
arrays/in-operator-with-boxed-needle.vala \
arrays/length-inline-assignment.vala \
diff --git a/tests/arrays/inline-struct.vala b/tests/arrays/inline-struct.vala
new file mode 100644
index 000000000..a8f05103b
--- /dev/null
+++ b/tests/arrays/inline-struct.vala
@@ -0,0 +1,18 @@
+[CCode (has_type_id = false)]
+public struct FooStruct {
+ public uint8 i;
+ public string s;
+}
+
+void main () {
+ {
+ FooStruct array[2];
+ array[0] = { 23, "foo"};
+ array[1] = { 42, "bar"};
+ }
+ {
+ GLib.Value array[2];
+ array[0].init (typeof (int));
+ array[1].init (typeof (string));
+ }
+}