提交 c70c6d4c 编写于 作者: J Jared Parsons

Fix a test

上级 6616f6f5
......@@ -56,24 +56,11 @@ private async Task TestSpanGetterAsync(string markup, Func<Document, int, TextSp
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingDataTips)]
public async Task TestCSharpLanguageDebugInfoGetDataTipSpanAndText()
{
await TestAsync(
@"class [|C$$|]
{
}");
await TestAsync(
@"struct [|C$$|]
{
}");
await TestAsync(
@"interface [|C$$|]
{
}");
await TestAsync(
@"enum [|C$$|]
{
}");
await TestAsync(
@"delegate void [|C$$|]();"); // Without the space, that position is actually on the open paren.
await TestAsync("class [|C$$|] { }");
await TestAsync("struct [|C$$|] { }");
await TestAsync("interface [|C$$|] { }");
await TestAsync("enum [|C$$|] { }");
await TestAsync("delegate void [|C$$|] ();"); // Without the space, that position is actually on the open paren.
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingDataTips)]
......@@ -82,10 +69,10 @@ public async Task Test1()
await TestAsync(
@"class C
{
void Foo()
{
[|Sys$$tem|].Console.WriteLine(args);
}
void Foo()
{
[|Sys$$tem|].Console.WriteLine(args);
}
}");
}
......@@ -95,10 +82,10 @@ public async Task Test2()
await TestAsync(
@"class C
{
void Foo()
{
[|System$$.Console|].WriteLine(args);
}
void Foo()
{
[|System$$.Console|].WriteLine(args);
}
}");
}
......@@ -108,10 +95,10 @@ public async Task Test3()
await TestAsync(
@"class C
{
void Foo()
{
[|System.$$Console|].WriteLine(args);
}
void Foo()
{
[|System.$$Console|].WriteLine(args);
}
}");
}
......@@ -121,10 +108,10 @@ public async Task Test4()
await TestAsync(
@"class C
{
void Foo()
{
[|System.Con$$sole|].WriteLine(args);
}
void Foo()
{
[|System.Con$$sole|].WriteLine(args);
}
}");
}
......@@ -134,10 +121,10 @@ public async Task Test5()
await TestAsync(
@"class C
{
void Foo()
{
[|System.Console.Wri$$teLine|](args);
}
void Foo()
{
[|System.Console.Wri$$teLine|](args);
}
}");
}
......@@ -147,10 +134,10 @@ public async Task Test6()
await TestNoDataTipAsync(
@"class C
{
void Foo()
{
[|System.Console.WriteLine$$|](args);
}
void Foo()
{
[|System.Console.WriteLine|]$$(args);
}
}");
}
......@@ -160,10 +147,10 @@ public async Task Test7()
await TestAsync(
@"class C
{
void Foo()
{
System.Console.WriteLine($$[|args|]);
}
void Foo()
{
System.Console.WriteLine($$[|args|]);
}
}");
}
......@@ -173,10 +160,10 @@ public async Task Test8()
await TestNoDataTipAsync(
@"class C
{
void Foo()
{
[|System.Console.WriteLine|](args$$);
}
void Foo()
{
[|System.Console.WriteLine|](args$$);
}
}");
}
......@@ -186,10 +173,10 @@ public async Task TestVar()
await TestAsync(
@"class C
{
void Foo()
{
[|va$$r|] v = 0;
}
void Foo()
{
[|va$$r|] v = 0;
}
}", "int");
}
......@@ -199,10 +186,10 @@ public async Task TestVariableType()
await TestAsync(
@"class C
{
void Foo()
{
[|in$$t|] i = 0;
}
void Foo()
{
[|in$$t|] i = 0;
}
}");
}
......@@ -212,10 +199,10 @@ public async Task TestVariableIdentifier()
await TestAsync(
@"class C
{
void Foo()
{
int $$[|i|] = 0;
}
void Foo()
{
int [|$$i|] = 0;
}
}");
}
......@@ -226,10 +213,10 @@ public async Task TestLiterals()
await TestAsync(
@"class C
{
void Foo()
{
int i = [|4$$2|];
}
void Foo()
{
int i = [|4$$2|];
}
}", "int");
}
......@@ -239,10 +226,10 @@ public async Task TestNonExpressions()
await TestNoDataTipAsync(
@"class C
{
void Foo()
{
int i = 42;
}$$
void Foo()
{
int i = 42;
}$$
}");
}
......@@ -252,9 +239,9 @@ public async Task TestParameterIdentifier()
await TestAsync(
@"class C
{
void Foo(int $$[|i|])
{
}
void Foo(int [|$$i|])
{
}
}");
}
......@@ -270,7 +257,7 @@ void Foo()
try
{
}
catch (System.Exception $$[|e|])
catch (System.Exception [|$$e|])
{
}
}
......@@ -283,21 +270,16 @@ public async Task TestEvent()
await TestAsync(
@"class C
{
event System.Action $$[|E|];
event System.Action [|$$E|];
}");
await TestAsync(
@"class C
{
event System.Action $$[|E|]
event System.Action [|$$E|]
{
add
{
}
remove
{
}
add { }
remove { }
}
}");
}
......@@ -308,25 +290,18 @@ public async Task TestMethod()
await TestAsync(
@"class C
{
int $$[|M|]()
{
}
int [|$$M|]() { }
}");
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingDataTips)]
public async Task TestTypeParameter()
{
await TestAsync(
@"class C<T, $$[|U|], V>
{
}");
await TestAsync("class C<T, [|$$U|], V> { }");
await TestAsync(
@"class C
{
void M<T, $$[|U|]>()
{
}
void M<T, [|$$U|]>() { }
}");
}
......@@ -334,7 +309,7 @@ public async Task TestTypeParameter()
public async Task UsingAlias()
{
await TestAsync(
@"using $$[|S|] = Static;
@"using [|$$S|] = Static;
static class Static
{
......@@ -348,12 +323,12 @@ public async Task TestForEachIdentifier()
await TestAsync(
@"class C
{
void Foo(string[] args)
void Foo(string[] args)
{
foreach (string [|$$s|] in args)
{
foreach (string $$[|s|] in args)
{
}
}
}
}");
}
......@@ -366,19 +341,16 @@ public async Task TestProperty()
{
class C
{
public int $$[|foo|] { get; private set; } // hover over me
public int [|$$foo|] { get; private set; } // hover over me
public C()
{
this.foo = 1;
}
public int Foo()
{
return 2; // breakpoint here
}
}
class Program
{
static void Main(string[] args)
......@@ -386,7 +358,8 @@ static void Main(string[] args)
new C().Foo();
}
}
}");
}
");
}
[Fact, Trait(Traits.Feature, Traits.Features.DebuggingDataTips)]
......@@ -397,8 +370,7 @@ public async Task TestQueryIdentifier()
{
object Foo(string[] args)
{
return from $$[|a|] in args
select a;
return from [|$$a|] in args select a;
}
}");
await TestAsync( // Let
......@@ -406,9 +378,7 @@ object Foo(string[] args)
{
object Foo(string[] args)
{
return from a in args
let $$[|b|] = ""END""
select a + b;
return from a in args let [|$$b|] = ""END"" select a + b;
}
}");
await TestAsync( // Join
......@@ -416,8 +386,7 @@ object Foo(string[] args)
{
object Foo(string[] args)
{
return from a in args
join $$[|b|] in args on a equals b;
return from a in args join [|$$b|] in args on a equals b;
}
}");
await TestAsync( // Join Into
......@@ -425,8 +394,7 @@ object Foo(string[] args)
{
object Foo(string[] args)
{
return from a in args
join b in args on a equals b into $$[|c|];
return from a in args join b in args on a equals b into [|$$c|];
}
}");
await TestAsync( // Continuation
......@@ -434,10 +402,7 @@ object Foo(string[] args)
{
object Foo(string[] args)
{
return from a in args
select a into $$[|b|]
from c in b
select c;
return from a in args select a into [|$$b|] from c in b select c;
}
}");
}
......@@ -543,4 +508,4 @@ class C
await TestAsync(string.Format(sourceTemplate, "/*1*/[|Me/*2*/?./*3*/B/*4*/?./*5*/$$C|]/*6*/"));
}
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册