do not check order sequence if option /order was not used
[mono.git] / mcs / tests / test-anon-07.cs
1 //
2 // Tests havign more than one anonymous method that captures the same variable
3 //
4 using System;
5
6 delegate void D ();
7
8 class X {
9         static int Main ()
10         {
11                 int a = 0;
12                 D d1 = delegate {
13                         Console.WriteLine ("First");
14                         a = 1;
15                 };
16                 
17                 D d2 = delegate {
18                         Console.WriteLine ("Second");
19                         a = 2;
20                 };
21                 if (!t (a, 0))
22                         return 1;
23                 d1 ();
24                 if (!t (a, 1))
25                         return 2;
26                 d2 ();
27                 if (!t (a, 2))
28                         return 3;
29                 Console.WriteLine ("Test passes OK");
30                 return 0;
31         }
32
33         static bool t (int a, int b)
34         {
35                 return a == b;
36         }
37 }