summaryrefslogtreecommitdiff
path: root/tests/parser/tuple.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-01-06 23:52:37 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-01-07 20:26:03 +0100
commitfa49ab772489616cd34495731245cef53ba57050 (patch)
tree70d3d2b3854e5316dac2e8c06a10a8f2e42e4202 /tests/parser/tuple.vala
parent62b4b3ab9e77397f1f72a1f7fd54b519fbbf34f5 (diff)
downloadvala-fa49ab772489616cd34495731245cef53ba57050.tar.gz
tests: Add "tuple" parser test to increase coverage
Diffstat (limited to 'tests/parser/tuple.vala')
-rw-r--r--tests/parser/tuple.vala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/parser/tuple.vala b/tests/parser/tuple.vala
new file mode 100644
index 000000000..1c16942de
--- /dev/null
+++ b/tests/parser/tuple.vala
@@ -0,0 +1,14 @@
+void main () {
+ string[] FOO = { "foo", null };
+ int[] BAR = { 42, 4711 };
+
+ unowned string? s, n;
+ (s, n) = FOO;
+ assert (s == "foo");
+ assert (n == null);
+
+ int i, j;
+ (i, j) = BAR;
+ assert (i == 42);
+ assert (j == 4711);
+}