Skip to content

Commit 4a716c6

Browse files
committed
C#: Add a test example in the statements test.
1 parent b392391 commit 4a716c6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

csharp/ql/test/library-tests/statements/statements.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Collections.Generic;
4+
using System.Threading;
45

56
namespace Statements
67
{
@@ -9,7 +10,7 @@ class Class
910

1011
static void Main()
1112
{
12-
block:
13+
block:
1314
{
1415
{
1516
}
@@ -166,8 +167,8 @@ static void MainGoto(string[] args)
166167
{
167168
int i = 0;
168169
goto check;
169-
loop: Console.WriteLine(args[i++]);
170-
check: if (i < args.Length) goto loop;
170+
loop: Console.WriteLine(args[i++]);
171+
check: if (i < args.Length) goto loop;
171172
}
172173

173174
static int Add(int a, int b)
@@ -272,9 +273,19 @@ static void MainUsing()
272273
static void MainLabeled()
273274
{
274275
goto Label;
275-
Label:
276+
Label:
276277
int x = 23;
277278
x = 9;
278279
}
280+
281+
private readonly Lock lockObject = new Lock();
282+
283+
public void LockMethod()
284+
{
285+
lock (lockObject)
286+
{
287+
Console.WriteLine("Locked");
288+
}
289+
}
279290
}
280291
}

0 commit comments

Comments
 (0)