Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
5ce63b13
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,发现更多精彩内容 >>
未验证
提交
5ce63b13
编写于
6月 27, 2017
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial set of VB conversion tests.
上级
e3d281de
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1268 addition
and
17 deletion
+1268
-17
src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb
...ilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb
+24
-17
src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
...isualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
+1
-0
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb
...antic/IOperation/IOperationTests_IConversionExpression.vb
+1243
-0
未找到文件。
src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb
浏览文件 @
5ce63b13
...
...
@@ -154,50 +154,57 @@ Public MustInherit Class SemanticModelTestBase : Inherits BasicTestBase
).
Where
(
Function
(
s
)
anyArity
OrElse
DirectCast
(
s
,
Symbol
).
GetArity
()
=
arity
.
Value
).
ToList
()
End
Function
Friend
Function
GetOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
Optional
which
As
Integer
=
0
)
As
String
Friend
Function
GetOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
Optional
which
As
Integer
=
0
)
As
(
Tree
As
String
,
Operation
As
IOperation
,
Syntax
As
SyntaxNode
)
Dim
node
As
SyntaxNode
=
CompilationUtils
.
FindBindingText
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
,
prefixMatch
:
=
True
)
If
node
Is
Nothing
Then
Return
Nothing
Return
(
Nothing
,
Nothing
,
Nothing
)
End
If
Dim
tree
=
(
From
t
In
compilation
.
SyntaxTrees
Where
t
.
FilePath
=
fileName
).
Single
()
Dim
semanticModel
=
compilation
.
GetSemanticModel
(
tree
)
Dim
operation
=
semanticModel
.
GetOperationInternal
(
node
)
Return
If
(
operation
IsNot
Nothing
,
OperationTreeVerifier
.
GetOperationTree
(
operation
),
Nothing
)
If
operation
IsNot
Nothing
Then
Return
(
OperationTreeVerifier
.
GetOperationTree
(
operation
),
operation
,
node
)
Else
Return
(
Nothing
,
Nothing
,
Nothing
)
End
If
End
Function
Friend
Function
GetOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
)
As
String
Friend
Function
GetOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
)
As
(
Tree
As
String
,
Operation
As
IOperation
,
Syntax
As
SyntaxNode
,
Compilation
As
Compilation
)
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
testSrc
,
fileName
,
parseOptions
)
Dim
compilation
=
CreateCompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
DefaultVbReferences
.
Append
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}),
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
Return
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
)
Dim
operationTreeInfo
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
)
Return
(
operationTreeInfo
.
Tree
,
operationTreeInfo
.
Operation
,
operationTreeInfo
.
Syntax
,
compilation
)
End
Function
Friend
Sub
VerifyOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
expectedOperationTree
As
String
,
Optional
which
As
Integer
=
0
)
Dim
actualOperationTree
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
)
OperationTreeVerifier
.
Verify
(
expectedOperationTree
,
actualOperationTree
)
Friend
Sub
VerifyOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
expectedOperationTree
As
String
,
Optional
which
As
Integer
=
0
,
Optional
additionalOperationTreeVerifier
As
Action
(
Of
IOperation
,
Compilation
,
SyntaxNode
)
=
Nothing
)
Dim
operationTreeInfo
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
)
OperationTreeVerifier
.
Verify
(
expectedOperationTree
,
operationTreeInfo
.
Tree
)
additionalOperationTreeVerifier
?
.
Invoke
(
operationTreeInfo
.
Operation
,
compilation
,
operationTreeInfo
.
Syntax
)
End
Sub
Friend
Sub
VerifyOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
expectedOperationTree
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
)
Dim
actualOperationTree
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
testSrc
,
compilationOptions
,
parseOptions
,
which
)
OperationTreeVerifier
.
Verify
(
expectedOperationTree
,
actualOperationTree
)
Friend
Sub
VerifyOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
expectedOperationTree
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
,
Optional
additionalOperationTreeVerifier
As
Action
(
Of
IOperation
,
Compilation
,
SyntaxNode
)
=
Nothing
)
Dim
operationTreeInfo
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
testSrc
,
compilationOptions
,
parseOptions
,
which
)
OperationTreeVerifier
.
Verify
(
expectedOperationTree
,
operationTreeInfo
.
Tree
)
additionalOperationTreeVerifier
?
.
Invoke
(
operationTreeInfo
.
Operation
,
operationTreeInfo
.
Compilation
,
operationTreeInfo
.
Syntax
)
End
Sub
Friend
Sub
VerifyNoOperationTreeForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
)
Dim
actualOperationTree
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
testSrc
,
compilationOptions
,
parseOptions
,
which
)
Assert
.
Null
(
actualOperation
Tree
)
Dim
operationTreeInfo
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
testSrc
,
compilationOptions
,
parseOptions
,
which
)
Assert
.
Null
(
operationTreeInfo
.
Tree
)
End
Sub
Friend
Sub
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
expectedOperationTree
As
String
,
expectedDiagnostics
As
String
,
Optional
which
As
Integer
=
0
)
Friend
Sub
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
compilation
As
VisualBasicCompilation
,
fileName
As
String
,
expectedOperationTree
As
String
,
expectedDiagnostics
As
String
,
Optional
which
As
Integer
=
0
,
Optional
additionalOperationTreeVerifier
As
Action
(
Of
IOperation
,
Compilation
,
SyntaxNode
)
=
Nothing
)
compilation
.
AssertTheseDiagnostics
(
FilterString
(
expectedDiagnostics
))
VerifyOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
expectedOperationTree
,
which
)
VerifyOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
expectedOperationTree
,
which
,
additionalOperationTreeVerifier
)
End
Sub
Friend
Sub
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
expectedOperationTree
As
String
,
expectedDiagnostics
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
)
Friend
Sub
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
As
SyntaxNode
)(
testSrc
As
String
,
expectedOperationTree
As
String
,
expectedDiagnostics
As
String
,
Optional
compilationOptions
As
VisualBasicCompilationOptions
=
Nothing
,
Optional
parseOptions
As
VisualBasicParseOptions
=
Nothing
,
Optional
which
As
Integer
=
0
,
Optional
additionalOperationTreeVerifier
As
Action
(
Of
IOperation
,
Compilation
,
SyntaxNode
)
=
Nothing
)
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
testSrc
,
fileName
,
parseOptions
)
Dim
compilation
=
CreateCompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
DefaultVbReferences
.
Append
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}),
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
,
which
)
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
,
which
,
additionalOperationTreeVerifier
)
End
Sub
Public
Shared
Function
GetAssertTheseDiagnosticsString
(
allDiagnostics
As
ImmutableArray
(
Of
Diagnostic
),
suppressInfos
As
Boolean
)
As
String
...
...
src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
浏览文件 @
5ce63b13
...
...
@@ -108,6 +108,7 @@
<Compile
Include=
"Diagnostics\DiagnosticTests.vb"
/>
<Compile
Include=
"Diagnostics\GetDiagnosticsTests.vb"
/>
<Compile
Include=
"IOperation\IOperationTests_IArgument.vb"
/>
<Compile
Include=
"IOperation\IOperationTests_IConversionExpression.vb"
/>
<Compile
Include=
"IOperation\IOperationTests_IFieldReferenceExpression.vb"
/>
<Compile
Include=
"IOperation\IOperationTests_IObjectCreationExpression.vb"
/>
<Compile
Include=
"IOperation\IOperationTests_IInterpolatedStringExpression.vb"
/>
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb
0 → 100644
浏览文件 @
5ce63b13
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录