From: Rico Tzschichholz Date: Wed, 1 Apr 2020 18:07:23 +0000 (+0200) Subject: tests: Extend "array foreach" test to increase coverage X-Git-Tag: 0.49.1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08837bd13043f1dbe0a198ad11499bb239abec7;p=thirdparty%2Fvala.git tests: Extend "array foreach" test to increase coverage --- diff --git a/tests/control-flow/foreach.vala b/tests/control-flow/foreach.vala index 0646c2d9a..6a36453fd 100644 --- a/tests/control-flow/foreach.vala +++ b/tests/control-flow/foreach.vala @@ -43,6 +43,7 @@ void test_foreach_multidim_array () { } const int[] FOO = { 1, 2, 3, 4, 5, 6 }; +const int BAR[] = { 6, 5, 4, 3, 2, 1 }; void test_foreach_const_array () { string result = ""; @@ -50,6 +51,12 @@ void test_foreach_const_array () { result += i.to_string (); } assert (result == "123456"); + + string result2 = ""; + foreach (var i in BAR) { + result2 += i.to_string (); + } + assert (result2 == "654321"); } void test_foreach_slice_array () {