[vala/0.48] tests: Extend "array field intializer" test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] tests: Extend "array field intializer" test to increase coverage
- Date: Wed, 19 May 2021 07:14:27 +0000 (UTC)
commit 5e48718ebe2773ed486d452ae7314e232818dca9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Apr 28 21:33:10 2021 +0200
tests: Extend "array field intializer" test to increase coverage
tests/arrays/class-field-initializer.vala | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/tests/arrays/class-field-initializer.vala b/tests/arrays/class-field-initializer.vala
index 30595f4ce..665c8d2aa 100644
--- a/tests/arrays/class-field-initializer.vala
+++ b/tests/arrays/class-field-initializer.vala
@@ -4,8 +4,10 @@ string[] manam;
class Foo {
public string[] f = manam;
public string[] i = { "baz", "foo", "bar" };
+ public string[] ia = { "baz", manam[0], "bar" };
public static string[] sf = manam;
public static string[] si = { "baz", "foo", "bar" };
+ public static string[] sa = { "baz", manam[0], "bar" };
}
[CCode (array_length = false)]
@@ -22,9 +24,15 @@ void main () {
assert (manam.length == 3);
var foo = new Foo ();
assert (foo.f.length == 3);
+ assert (foo.f[0] == "manam");
assert (Foo.sf.length == 3);
+ assert (Foo.sf[0] == "manam");
assert (foo.i.length == 3);
+ assert (foo.ia.length == 3);
+ assert (foo.ia[1] == "manam");
assert (Foo.si.length == 3);
+ assert (Foo.sa.length == 3);
+ assert (Foo.sa[1] == "manam");
}
{
minim = { "minim", "foo", "bar" };
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]