2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git] / tests / gtest-collectioninit-01.cs
blob11faccdbcd2284a935cd19992e51db0e929f7c31
1 // Compiler options: -langversion:linq
2 // Tests collection initialization
3 using System;
4 using System.Collections;
5 using System.Collections.Generic;
7 public class Test
9 static int Main ()
11 ArrayList collection = new ArrayList { "Foo", "Bar", "Baz" };
12 foreach (string s in collection)
13 if (s.Length != 3)
14 return 1;
16 List<string> generic_collection = new List<string> { "Hello", "World" };
17 foreach (string s in generic_collection)
18 if (s.Length != 5)
19 return 2;
21 return 0;