Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
54efe21b
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,发现更多精彩内容 >>
提交
54efe21b
编写于
4月 24, 2017
作者:
I
Ivan Basov
提交者:
GitHub
4月 24, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enc pdb tests
#18883
上级
3d190e6f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
171 addition
and
0 deletion
+171
-0
src/Compilers/CSharp/Test/Emit/PDB/PDBTests.cs
src/Compilers/CSharp/Test/Emit/PDB/PDBTests.cs
+171
-0
未找到文件。
src/Compilers/CSharp/Test/Emit/PDB/PDBTests.cs
浏览文件 @
54efe21b
...
...
@@ -23,6 +23,8 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests.PDB
{
public
class
PDBTests
:
CSharpPDBTestBase
{
private
static
readonly
MetadataReference
[]
s_valueTupleRefs
=
new
[]
{
SystemRuntimeFacadeRef
,
ValueTupleRef
};
#
region
General
[
Fact
]
...
...
@@ -5765,6 +5767,175 @@ static void M()
#
endregion
#
region
Patterns
public
void
SyntaxOffset_Pattern
()
{
var
source
=
@"class C { bool F(object o) => o is int i && o is 3 && o is bool; }"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
source
,
options
:
TestOptions
.
DebugDll
);
c
.
VerifyPdb
(
"C.F"
,
@"<symbols>
<methods>
<method containingType=""C"" name=""F"" parameterNames=""o"">
<customDebugInfo>
<using>
<namespace usingCount=""0"" />
</using>
<encLocalSlotMap>
<slot kind=""0"" offset=""12"" />
<slot kind=""temp"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints>
<entry offset=""0x0"" startLine=""1"" startColumn=""31"" endLine=""1"" endColumn=""64"" />
</sequencePoints>
<scope startOffset=""0x0"" endOffset=""0x38"">
<local name=""i"" il_index=""0"" il_start=""0x0"" il_end=""0x38"" attributes=""0"" />
</scope>
</method>
</methods>
</symbols>"
);
}
#
endregion
#
region
Tuples
[
Fact
]
public
void
SyntaxOffset_TupleDeconstruction
()
{
var
source
=
@"class C { int F() { (int a, (_, int c)) = (1, (2, 3)); return a + c; } }"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
source
,
options
:
TestOptions
.
DebugDll
,
references
:
s_valueTupleRefs
);
c
.
VerifyPdb
(
"C.F"
,
@"<symbols>
<methods>
<method containingType=""C"" name=""F"">
<customDebugInfo>
<using>
<namespace usingCount=""0"" />
</using>
<encLocalSlotMap>
<slot kind=""0"" offset=""7"" />
<slot kind=""0"" offset=""18"" />
<slot kind=""21"" offset=""0"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints>
<entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""20"" />
<entry offset=""0x1"" startLine=""1"" startColumn=""21"" endLine=""1"" endColumn=""55"" />
<entry offset=""0x5"" startLine=""1"" startColumn=""56"" endLine=""1"" endColumn=""69"" />
<entry offset=""0xb"" startLine=""1"" startColumn=""70"" endLine=""1"" endColumn=""71"" />
</sequencePoints>
<scope startOffset=""0x0"" endOffset=""0xd"">
<local name=""a"" il_index=""0"" il_start=""0x0"" il_end=""0xd"" attributes=""0"" />
<local name=""c"" il_index=""1"" il_start=""0x0"" il_end=""0xd"" attributes=""0"" />
</scope>
</method>
</methods>
</symbols>"
);
}
[
Fact
]
public
void
SyntaxOffset_TupleParenthesized
()
{
var
source
=
@"class C { int F() { (int, (int, int)) x = (1, (2, 3)); return x.Item1 + x.Item2.Item1 + x.Item2.Item2; } }"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
source
,
options
:
TestOptions
.
DebugDll
,
references
:
s_valueTupleRefs
);
c
.
VerifyPdb
(
"C.F"
,
@"<symbols>
<methods>
<method containingType=""C"" name=""F"">
<customDebugInfo>
<using>
<namespace usingCount=""0"" />
</using>
<encLocalSlotMap>
<slot kind=""0"" offset=""20"" />
<slot kind=""21"" offset=""0"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints>
<entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""20"" />
<entry offset=""0x1"" startLine=""1"" startColumn=""21"" endLine=""1"" endColumn=""55"" />
<entry offset=""0x10"" startLine=""1"" startColumn=""56"" endLine=""1"" endColumn=""103"" />
<entry offset=""0x31"" startLine=""1"" startColumn=""104"" endLine=""1"" endColumn=""105"" />
</sequencePoints>
<scope startOffset=""0x0"" endOffset=""0x33"">
<local name=""x"" il_index=""0"" il_start=""0x0"" il_end=""0x33"" attributes=""0"" />
</scope>
</method>
</methods>
</symbols>"
);
}
[
Fact
]
public
void
SyntaxOffset_TupleVarDefined
()
{
var
source
=
@"class C { int F() { var x = (1, 2); return x.Item1 + x.Item2; } }"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
source
,
options
:
TestOptions
.
DebugDll
,
references
:
s_valueTupleRefs
);
c
.
VerifyPdb
(
"C.F"
,
@"<symbols>
<methods>
<method containingType=""C"" name=""F"">
<customDebugInfo>
<using>
<namespace usingCount=""0"" />
</using>
<encLocalSlotMap>
<slot kind=""0"" offset=""6"" />
<slot kind=""21"" offset=""0"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints>
<entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""20"" />
<entry offset=""0x1"" startLine=""1"" startColumn=""21"" endLine=""1"" endColumn=""36"" />
<entry offset=""0xa"" startLine=""1"" startColumn=""37"" endLine=""1"" endColumn=""62"" />
<entry offset=""0x1a"" startLine=""1"" startColumn=""63"" endLine=""1"" endColumn=""64"" />
</sequencePoints>
<scope startOffset=""0x0"" endOffset=""0x1c"">
<local name=""x"" il_index=""0"" il_start=""0x0"" il_end=""0x1c"" attributes=""0"" />
</scope>
</method>
</methods>
</symbols>"
);
}
[
Fact
]
public
void
SyntaxOffset_TupleIgnoreDeconstructionIfVariableDeclared
()
{
var
source
=
@"class C { int F() { (int x, int y) a = (1, 2); return a.Item1 + a.Item2; } }"
;
var
c
=
CreateCompilationWithMscorlibAndSystemCore
(
source
,
options
:
TestOptions
.
DebugDll
,
references
:
s_valueTupleRefs
);
c
.
VerifyPdb
(
"C.F"
,
@"<symbols>
<methods>
<method containingType=""C"" name=""F"">
<customDebugInfo>
<using>
<namespace usingCount=""0"" />
</using>
<tupleElementNames>
<local elementNames=""|x|y"" slotIndex=""0"" localName=""a"" scopeStart=""0x0"" scopeEnd=""0x0"" />
</tupleElementNames>
<encLocalSlotMap>
<slot kind=""0"" offset=""17"" />
<slot kind=""21"" offset=""0"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints>
<entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""20"" />
<entry offset=""0x1"" startLine=""1"" startColumn=""21"" endLine=""1"" endColumn=""47"" />
<entry offset=""0x9"" startLine=""1"" startColumn=""48"" endLine=""1"" endColumn=""73"" />
<entry offset=""0x19"" startLine=""1"" startColumn=""74"" endLine=""1"" endColumn=""75"" />
</sequencePoints>
<scope startOffset=""0x0"" endOffset=""0x1b"">
<local name=""a"" il_index=""0"" il_start=""0x0"" il_end=""0x1b"" attributes=""0"" />
</scope>
</method>
</methods>
</symbols>"
);
}
#
endregion
[
Fact
,
WorkItem
(
4370
,
"https://github.com/dotnet/roslyn/issues/4370"
)]
public
void
HeadingHiddenSequencePointsPickUpDocumentFromVisibleSequencePoint
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录