From 6d8c8d26cb09205caf8ec7d23a09247d8e395ec5 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sat, 6 Jan 2018 23:52:37 +0100 Subject: [PATCH] tests: Add "tuple" parser test to increase coverage --- tests/Makefile.am | 1 + tests/parser/tuple.vala | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/parser/tuple.vala diff --git a/tests/Makefile.am b/tests/Makefile.am index fab97764b..22ce5d1d3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -314,6 +314,7 @@ TESTS = \ annotations/description.vala \ annotations/noaccessormethod.test \ 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); +} -- 2.47.2