Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
286cb21c
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
286cb21c
编写于
3月 17, 2015
作者:
B
Brett Forsgren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update unit tests to use localized resources
上级
50e81ffc
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
110 addition
and
111 deletion
+110
-111
src/EditorFeatures/CSharpTest/EditAndContinue/ActiveStatementTests.cs
...atures/CSharpTest/EditAndContinue/ActiveStatementTests.cs
+65
-65
src/EditorFeatures/CSharpTest/EditAndContinue/RudeEditStatementTests.cs
...ures/CSharpTest/EditAndContinue/RudeEditStatementTests.cs
+45
-46
未找到文件。
src/EditorFeatures/CSharpTest/EditAndContinue/ActiveStatementTests.cs
浏览文件 @
286cb21c
此差异已折叠。
点击以展开。
src/EditorFeatures/CSharpTest/EditAndContinue/RudeEditStatementTests.cs
浏览文件 @
286cb21c
...
...
@@ -2,7 +2,6 @@
using
System.Collections.Generic
;
using
System.IO
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.EditAndContinue
;
using
Microsoft.CodeAnalysis.EditAndContinue.UnitTests
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
...
...
@@ -2664,18 +2663,18 @@ void F()
var
insert
=
GetTopEdits
(
src1
,
src2
);
insert
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x1"
,
"lambda"
,
"y0"
,
"x1"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x3"
,
"lambda"
,
"x1"
,
"x3"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"y0"
,
"lambda"
,
"this"
,
"y0"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x3"
,
"lambda"
,
"this"
,
"x3"
));
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x1"
,
CSharpFeaturesResources
.
Lambda
,
"y0"
,
"x1"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x3"
,
CSharpFeaturesResources
.
Lambda
,
"x1"
,
"x3"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"y0"
,
CSharpFeaturesResources
.
Lambda
,
"this"
,
"y0"
),
Diagnostic
(
RudeEditKind
.
InsertLambdaWithMultiScopeCapture
,
"x3"
,
CSharpFeaturesResources
.
Lambda
,
"this"
,
"x3"
));
var
delete
=
GetTopEdits
(
src2
,
src1
);
delete
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x1"
,
"lambda"
,
"y0"
,
"x1"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x3"
,
"lambda"
,
"x1"
,
"x3"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"y0"
,
"lambda"
,
"this"
,
"y0"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x3"
,
"lambda"
,
"this"
,
"x3"
));
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x1"
,
CSharpFeaturesResources
.
Lambda
,
"y0"
,
"x1"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x3"
,
CSharpFeaturesResources
.
Lambda
,
"x1"
,
"x3"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"y0"
,
CSharpFeaturesResources
.
Lambda
,
"this"
,
"y0"
),
Diagnostic
(
RudeEditKind
.
DeleteLambdaWithMultiScopeCapture
,
"x3"
,
CSharpFeaturesResources
.
Lambda
,
"this"
,
"x3"
));
}
[
Fact
]
...
...
@@ -2747,7 +2746,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -2784,7 +2783,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(a, b)"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(a, b)"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -2821,7 +2820,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaReturnType
,
"a"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaReturnType
,
"a"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -2894,7 +2893,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaReturnType
,
"a"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaReturnType
,
"a"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3009,7 +3008,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(int a)"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(int a)"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3052,7 +3051,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(out int a)"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(out int a)"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
(
Skip
=
"TODO"
)]
...
...
@@ -3266,7 +3265,7 @@ void F()
"
;
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3314,7 +3313,7 @@ void F()
"
;
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"a"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3393,7 +3392,7 @@ void F()
"
;
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(a, b)"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
ChangingLambdaParameters
,
"(a, b)"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3435,7 +3434,7 @@ void F()
// y is no longer captured in f2
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a2"
,
"y"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a2"
,
"y"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3591,7 +3590,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"a1"
,
"this"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"a1"
,
"this"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3632,8 +3631,8 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x"
,
"x"
,
"lambda"
).
WithFirstLine
(
"x+ // 1"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x"
,
"x"
,
"lambda"
).
WithFirstLine
(
"x; // 2"
));
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x"
,
"x"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"x+ // 1"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x"
,
"x"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"x; // 2"
));
}
[
Fact
]
...
...
@@ -3672,7 +3671,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"y"
,
"y"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"y"
,
"y"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3795,7 +3794,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x0"
,
"x0"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x0"
,
"x0"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3849,7 +3848,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"x0"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"x0"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3905,7 +3904,7 @@ void F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x0"
,
"x0"
,
"lambda"
));
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"x0"
,
"x0"
,
CSharpFeaturesResources
.
Lambda
));
}
[
Fact
]
...
...
@@ -3963,10 +3962,10 @@ void F()
// TODO: "a => x + x0" is matched with "a => y1 + x0", hence we report more errors.
// Including statement distance when matching would help.
edits
.
VerifySemanticDiagnostics
(
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"this"
,
"lambda"
).
WithFirstLine
(
"G(a => y1 + x0); // error: connecting previously disconnected closures"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"y1"
,
"y1"
,
"lambda"
).
WithFirstLine
(
"G(a => y1 + x0); // error: connecting previously disconnected closures"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"a"
,
"this"
,
"lambda"
).
WithFirstLine
(
"G(a => x); // error: disconnecting previously connected closures"
),
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"y1"
,
"lambda"
).
WithFirstLine
(
"G(a => x); // error: disconnecting previously connected closures"
));
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"this"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"G(a => y1 + x0); // error: connecting previously disconnected closures"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"y1"
,
"y1"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"G(a => y1 + x0); // error: connecting previously disconnected closures"
),
Diagnostic
(
RudeEditKind
.
AccessingCapturedVariableInLambda
,
"a"
,
"this"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"G(a => x); // error: disconnecting previously connected closures"
),
Diagnostic
(
RudeEditKind
.
NotAccessingCapturedVariableInLambda
,
"a"
,
"y1"
,
CSharpFeaturesResources
.
Lambda
).
WithFirstLine
(
"G(a => x); // error: disconnecting previously connected closures"
));
}
#
endregion
...
...
@@ -4280,8 +4279,8 @@ static IEnumerable<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Update
,
"yield break;"
,
"yield statement"
),
Diagnostic
(
RudeEditKind
.
Update
,
"yield return 4;"
,
"yield statement"
));
Diagnostic
(
RudeEditKind
.
Update
,
"yield break;"
,
CSharpFeaturesResources
.
YieldStatement
),
Diagnostic
(
RudeEditKind
.
Update
,
"yield return 4;"
,
CSharpFeaturesResources
.
YieldStatement
));
}
[
Fact
]
...
...
@@ -4330,7 +4329,7 @@ static IEnumerable<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Delete
,
"{"
,
"yield statement"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"{"
,
CSharpFeaturesResources
.
YieldStatement
));
}
[
Fact
]
...
...
@@ -4382,8 +4381,8 @@ static IEnumerable<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Insert
,
"yield return 4;"
,
"yield statement"
),
Diagnostic
(
RudeEditKind
.
Insert
,
"yield return 2;"
,
"yield statement"
));
Diagnostic
(
RudeEditKind
.
Insert
,
"yield return 4;"
,
CSharpFeaturesResources
.
YieldStatement
),
Diagnostic
(
RudeEditKind
.
Insert
,
"yield return 2;"
,
CSharpFeaturesResources
.
YieldStatement
));
}
#
endregion
...
...
@@ -4549,7 +4548,7 @@ static async Task<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Delete
,
"F(2);"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"F(2);"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4576,7 +4575,7 @@ static async Task<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Delete
,
"await F(1);"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"await F(1);"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4597,7 +4596,7 @@ class C
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Delete
,
"=> await F(1)"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"=> await F(1)"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4618,7 +4617,7 @@ class C
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
ActiveStatementsDescription
.
Empty
,
Diagnostic
(
RudeEditKind
.
Delete
,
"=> F(1)"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"=> F(1)"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4672,8 +4671,8 @@ static async IEnumerable<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4702,10 +4701,10 @@ static async IEnumerable<int> F()
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Delete
,
"await"
,
"await expression"
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Delete
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
),
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
@@ -4726,7 +4725,7 @@ class C
var
edits
=
GetTopEdits
(
src1
,
src2
);
edits
.
VerifyRudeDiagnostics
(
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
"await expression"
));
Diagnostic
(
RudeEditKind
.
Insert
,
"await"
,
CSharpFeaturesResources
.
AwaitExpression
));
}
[
Fact
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录