Merge pull request #4419 from BrzVlad/fix-oom-nre
[mono.git] / mcs / tests / gtest-implicitarray-01.cs
1
2 // Tests implicitly typed arrays
3
4 public class Test
5 {
6         public static int Main ()
7         {
8                 string[] array = new [] { "Foo", "Bar", "Baz" };
9                 foreach (string s in array)
10                         if (s.Length != 3)
11                                 return 1;
12
13                 string[] s1 = new[] { null, "a", default (string) };
14                 double[] s2 = new[] { 0, 1.0, 2 };
15                         
16                 var a1 = new[] { null, "a", default (string) };
17                 var a2 = new[] { 0, 1.0, 2 }; 
18                 var a3 = new[] { new Test (), null }; 
19                 var a4 = new[,] { { 1, 2, 3 }, { 4, 5, 6 } };
20                 var a5 = new[] { default (object) };
21                 var a6 = new[] { new [] { 1, 2, 3 }, new [] { 4, 5, 6 } };
22                 
23                 const byte b = 100;
24                 int[] a7 = new[] { b, 10, b, 999, b };
25                 
26                 var a8 = new[] { new Test (), 22,  new object(), string.Empty, null };
27
28                 int[] a9 = new [] { 1, (byte) 1 };
29                 
30                 return 0;
31         }
32 }