[vala/0.36: 131/212] tests: Add "tuple" parser test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36: 131/212] tests: Add "tuple" parser test to increase coverage
- Date: Sat, 14 Apr 2018 07:54:22 +0000 (UTC)
commit 237e08a51059f3cb75faa9032f71b1c7ae67febd
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Jan 6 23:52:37 2018 +0100
tests: Add "tuple" parser test to increase coverage
tests/Makefile.am | 1 +
tests/parser/tuple.vala | 14 ++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 96016d5..24a99b5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -312,6 +312,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 0000000..1c16942
--- /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);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]