提交 6616f6f5 编写于 作者: J Jared Parsons

Fix a few tests

上级 df992774
......@@ -33,10 +33,7 @@ private async Task TestAsync(string markup, string expectedName, int expectedLin
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
public async Task TestClass()
{
await TestAsync(
@"class F$$oo
{
}", "Foo", 0);
await TestAsync("class F$$oo { }", "Foo", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -49,7 +46,8 @@ public async Task TestMethod()
public static void Meth$$od()
{
}
}", "Class.Method()", 0);
}
", "Class.Method()", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -175,9 +173,7 @@ public async Task TestLambdaInFieldInitializer()
await TestAsync(
@"class Class
{
Action<int> a = b => {
in$$t c;
};
Action<int> a = b => { in$$t c; };
}", "Class.a", 0);
}
......@@ -200,8 +196,10 @@ public async Task TestConstructor()
{
C1()
{
$$}
}", "C1.C1()", 3);
}
", "C1.C1()", 3);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -213,7 +211,8 @@ public async Task TestDestructor()
~C1()
{
$$}
}", "C1.~C1()", 2);
}
", "C1.~C1()", 2);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -229,7 +228,8 @@ class C1
$$return 42;
}
}
}", "N1.C1.+(C1 x, C1 y)", 2); // Old implementation reports "operator +" (rather than "+")...
}
", "N1.C1.+(C1 x, C1 y)", 2); // Old implementation reports "operator +" (rather than "+")...
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -245,11 +245,11 @@ class C1
$$return null;
}
}
class C2
{
}
}", "N1.C1.N1.C2(N1.C1 x)", 2); // Old implementation reports "explicit operator N1.C2" (rather than "N1.C2")...
}
", "N1.C1.N1.C2(N1.C1 x)", 2); // Old implementation reports "explicit operator N1.C2" (rather than "N1.C2")...
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -259,9 +259,9 @@ public async Task TestEvent()
@"class C1
{
delegate void D1();
event D1 e1$$;
}", "C1.e1", 0);
}
", "C1.e1", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -272,13 +272,13 @@ public async Task TextExplicitInterfaceImplementation()
{
void M1();
}
class C1
{
void I1.M1()
{
$$}
}", "C1.M1()", 2);
}
", "C1.M1()", 2);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -294,7 +294,8 @@ public async Task TextIndexer()
$$return null;
}
}
}", "C1.this[int x]", 4);
}
", "C1.this[int x]", 4);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -303,11 +304,9 @@ public async Task TestParamsParameter()
await TestAsync(
@"class C1
{
void M1(params int[] x)
{
$$
}
}", "C1.M1(params int[] x)", 0);
void M1(params int[] x) { $$ }
}
", "C1.M1(params int[] x)", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -316,11 +315,9 @@ public async Task TestArglistParameter()
await TestAsync(
@"class C1
{
void M1(__arglist)
{
$$
}
}", "C1.M1(__arglist)", 0); // Old implementation does not show "__arglist"...
void M1(__arglist) { $$ }
}
", "C1.M1(__arglist)", 0); // Old implementation does not show "__arglist"...
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -329,11 +326,12 @@ public async Task TestRefAndOutParameters()
await TestAsync(
@"class C1
{
void M1(ref int x, out int y)
void M1( ref int x, out int y )
{
$$y = x;
}
}", "C1.M1( ref int x, out int y )", 2); // Old implementation did not show extra spaces around the parameters...
}
", "C1.M1( ref int x, out int y )", 2); // Old implementation did not show extra spaces around the parameters...
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -342,11 +340,12 @@ public async Task TestOptionalParameters()
await TestAsync(
@"class C1
{
void M1(int x = 1)
void M1(int x =1)
{
$$y = x;
}
}", "C1.M1(int x =1)", 2);
}
", "C1.M1(int x =1)", 2);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -358,7 +357,8 @@ public async Task TestExtensionMethod()
static void M1(this int x)
{
}$$
}", "C1.M1(this int x)", 2);
}
", "C1.M1(this int x)", 2);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -367,11 +367,9 @@ public async Task TestGenericType()
await TestAsync(
@"class C1<T, U>
{
static void M1()
{
$$
}
}", "C1.M1()", 0);
static void M1() { $$ }
}
", "C1.M1()", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -380,11 +378,9 @@ public async Task TestGenericMethod()
await TestAsync(
@"class C1<T, U>
{
static void M1<V>()
{
$$
}
}", "C1.M1()", 0);
static void M1<V>() { $$ }
}
", "C1.M1()", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -393,11 +389,9 @@ public async Task TestGenericParameters()
await TestAsync(
@"class C1<T, U>
{
static void M1<V>(C1<int, V> x, V y)
{
$$
}
}", "C1.M1(C1<int, V> x, V y)", 0);
static void M1<V>(C1<int, V> x, V y) { $$ }
}
", "C1.M1(C1<int, V> x, V y)", 0);
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -406,9 +400,9 @@ public async Task TestMissingNamespace()
await TestAsync(
@"{
class Class
{
{
int a1, a$$2;
}
}
}", "Class.a2", 0);
}
......@@ -435,9 +429,9 @@ public async Task TestMissingClassName()
class
{
int M1()
$${
}
}
$${
}
}
}", "N1.M1()", 1); // Old implementation displayed "N1.?.M1", but we don't see a class declaration in the syntax tree...
}
......@@ -464,7 +458,9 @@ public async Task TestMissingParameterList()
{
class C1
{
static void M1 { $$}
static void M1
{
$$}
}
}", "N1.C1.M1", 2);
}
......@@ -473,7 +469,8 @@ class C1
public async Task TopLevelField()
{
await TestAsync(
@"$$int f1;", "f1", 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
@"$$int f1;
", "f1", 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
......@@ -482,14 +479,18 @@ public async Task TopLevelMethod()
await TestAsync(
@"int M1(int x)
{
$$}", "M1(int x)", 2, new CSharpParseOptions(kind: SourceCodeKind.Script));
$$}
", "M1(int x)", 2, new CSharpParseOptions(kind: SourceCodeKind.Script));
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingLocationName)]
public async Task TopLevelStatement()
{
await TestAsync(
@"$$System.Console.WriteLine(""Hello"")", null, 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
@"
$$System.Console.WriteLine(""Hello"")
", null, 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册