]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add test for fixed size arrays
authorMichal Hruby <michal.mhr@gmail.com>
Thu, 10 Mar 2011 16:45:57 +0000 (17:45 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 10 Mar 2011 19:27:45 +0000 (20:27 +0100)
tests/basic-types/arrays.vala

index ff32f2da881875f4758262a5d34936afe0a474cd..0b80cf6ab3a33de5cc64fcf632c07b1b7d4d4193 100644 (file)
@@ -71,9 +71,19 @@ void test_array_pass () {
        assert (b[0] == 42);
 }
 
+void test_static_array () {
+       int a[2];
+       assert (a.length == 2);
+       a[1] = 23;
+       assert (a[1] == 23);
+       a = { 23, 34 };
+       assert (a[0] == 23 && a[1] == 34);
+}
+
 void main () {
        test_integer_array ();
        test_string_array ();
        test_array_pass ();
+       test_static_array ();
 }