1 void test_integer_array () {
2 // declaration and initialization
4 assert (a
.length
== 1);
9 assert (a
.length
== 2);
15 assert (b
.length
== 2);
21 assert (a
.length
== 3);
25 assert (b
.length
== 2);
31 assert (c
.length
== 2);
40 void test_string_array () {
41 // declaration and initialization
42 string[] a
= { "hello" };
43 assert (a
.length
== 1);
44 assert (a
[0] == "hello");
47 a
= { "hello", "world" };
48 assert (a
.length
== 2);
49 assert (a
[0] == "hello");
50 assert (a
[1] == "world");
54 assert (b
.length
== 2);
55 assert (b
[0] == "hello");
56 assert (b
[1] == "world");
59 int[] pass_helper (int[] a
, out int[] b
) {
64 void test_array_pass () {
66 a
= pass_helper ({ 42 }, out b
);
67 assert (a
.length
== 2);
70 assert (b
.length
== 1);
74 void test_static_array () {
76 assert (a
.length
== 2);
80 assert (a
[0] == 23 && a
[1] == 34);
84 test_integer_array ();