From: Rico Tzschichholz Date: Sat, 6 Jan 2018 22:52:37 +0000 (+0100) Subject: tests: Add "tuple" parser test to increase coverage X-Git-Tag: 0.39.4~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa49ab772489616cd34495731245cef53ba57050;p=thirdparty%2Fvala.git tests: Add "tuple" parser test to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index afcc04a4d..95cc6f282 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -319,6 +319,7 @@ TESTS = \ annotations/noaccessormethod.test \ parser/switch-statement.vala \ parser/template.vala \ + parser/tuple.vala \ $(NULL) NON_NULL_TESTS = \ 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); +}