Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
010b55a6
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,发现更多精彩内容 >>
提交
010b55a6
编写于
8月 09, 2017
作者:
P
Petr Onderka
提交者:
Julien Couvreur
8月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests on cs-CZ culture (#21171)
Merged on behalf of @svick Thanks for the contribution!
上级
df8ba1c7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
7 deletion
+29
-7
src/Compilers/Core/CodeAnalysisTest/Text/StringTextDecodingTests.cs
...ers/Core/CodeAnalysisTest/Text/StringTextDecodingTests.cs
+1
-1
src/Test/Utilities/Portable/Assert/ConditionalFactAttribute.cs
...est/Utilities/Portable/Assert/ConditionalFactAttribute.cs
+7
-0
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
...t/Utilities/Portable/Compilation/OperationTreeVerifier.cs
+21
-6
未找到文件。
src/Compilers/Core/CodeAnalysisTest/Text/StringTextDecodingTests.cs
浏览文件 @
010b55a6
...
...
@@ -133,7 +133,7 @@ public void CheckSum_SHA256()
Assert
.
Equal
(
"f1945cd6 c19e56b3 c1c78943 ef5ec181 16907a4c a1efc40a 57d48ab1 db7adfc5"
,
StringTextTest
.
ChecksumToHexQuads
(
checksum
));
}
[
ConditionalFact
(
typeof
(
IsEnglishLocal
))]
[
ConditionalFact
(
typeof
(
HasEnglishDefaultEncoding
))]
[
WorkItem
(
5663
,
"https://github.com/dotnet/roslyn/issues/5663"
)]
public
void
Decode_NonUtf8
()
{
...
...
src/Test/Utilities/Portable/Assert/ConditionalFactAttribute.cs
浏览文件 @
010b55a6
...
...
@@ -47,6 +47,13 @@ public class HasShiftJisDefaultEncoding : ExecutionCondition
public
override
string
SkipReason
=>
"OS default codepage is not Shift-JIS (932)."
;
}
public
class
HasEnglishDefaultEncoding
:
ExecutionCondition
{
public
override
bool
ShouldSkip
=>
Encoding
.
GetEncoding
(
0
)?.
CodePage
!=
1252
;
public
override
string
SkipReason
=>
"OS default codepage is not Windows-1252."
;
}
public
class
IsEnglishLocal
:
ExecutionCondition
{
public
override
bool
ShouldSkip
=>
...
...
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
浏览文件 @
010b55a6
...
...
@@ -4,6 +4,7 @@
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Diagnostics
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
...
...
@@ -163,13 +164,28 @@ private void LogConstant(Optional<object> constant, string header = "Constant")
}
}
private
void
LogConstant
(
object
constant
,
string
header
=
"Constant"
)
private
static
string
ConstantToString
(
object
constant
,
bool
quoteString
=
true
)
{
var
valueStr
=
constant
!=
null
?
constant
.
ToString
()
:
"null"
;
if
(
constant
is
string
)
switch
(
constant
)
{
valueStr
=
@""""
+
valueStr
+
@""""
;
case
null
:
return
"null"
;
case
string
s
:
if
(
quoteString
)
{
return
@""""
+
s
+
@""""
;
}
return
s
;
case
IFormattable
formattable
:
return
formattable
.
ToString
(
null
,
CultureInfo
.
InvariantCulture
);
default
:
return
constant
.
ToString
();
}
}
private
void
LogConstant
(
object
constant
,
string
header
=
"Constant"
)
{
string
valueStr
=
ConstantToString
(
constant
);
LogString
(
$"
{
header
}
:
{
valueStr
}
"
);
}
...
...
@@ -845,8 +861,7 @@ public override void VisitLiteralExpression(ILiteralExpression operation)
{
LogString
(
nameof
(
ILiteralExpression
));
object
value
;
if
(
operation
.
ConstantValue
.
HasValue
&&
((
value
=
operation
.
ConstantValue
.
Value
)
==
null
?
"null"
:
value
.
ToString
())
==
operation
.
Text
)
if
(
operation
.
ConstantValue
.
HasValue
&&
ConstantToString
(
operation
.
ConstantValue
.
Value
,
quoteString
:
false
)
==
operation
.
Text
)
{
LogString
(
$" (Text:
{
operation
.
Text
}
)"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录