Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
1e343258
R
runtime
项目概览
dotNET Platform
/
runtime
9 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
1e343258
编写于
7月 18, 2023
作者:
T
Tarek Mahmoud Sayed
提交者:
GitHub
7月 18, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TestOnly] port test fixes (#89063)
上级
21209de7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
10 deletion
+26
-10
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
...System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
+3
-3
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs
...ts/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs
+6
-5
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.cs
...alization/tests/NumberFormatInfo/NumberFormatInfoTests.cs
+17
-2
未找到文件。
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs
浏览文件 @
1e343258
...
...
@@ -254,8 +254,8 @@ public static IEnumerable<object[]> Ctor_String_TestData()
yield
return
new
object
[]
{
"pa-IN"
,
new
[]
{
"pa-IN"
},
true
};
yield
return
new
object
[]
{
"pl"
,
new
[]
{
"pl"
}
};
yield
return
new
object
[]
{
"pl-PL"
,
new
[]
{
"pl-PL"
}
};
yield
return
new
object
[]
{
"prs"
,
new
[]
{
"prs"
},
true
};
yield
return
new
object
[]
{
"prs-AF"
,
new
[]
{
"prs-AF"
},
true
};
yield
return
new
object
[]
{
"prs"
,
new
[]
{
"prs"
,
"fa"
},
true
};
yield
return
new
object
[]
{
"prs-AF"
,
new
[]
{
"prs-AF"
,
"fa-AF"
},
true
};
yield
return
new
object
[]
{
"ps"
,
new
[]
{
"ps"
},
true
};
yield
return
new
object
[]
{
"ps-AF"
,
new
[]
{
"ps-AF"
},
true
};
yield
return
new
object
[]
{
"pt"
,
new
[]
{
"pt"
}
};
...
...
@@ -441,7 +441,7 @@ public void TestCreationWithTemporaryLCID(int lcid)
Assert
.
NotEqual
(
lcid
,
new
CultureInfo
(
lcid
).
LCID
);
}
private
static
bool
NotWasmWithIcu
=>
PlatformDetection
.
IsNotBrowser
&&
PlatformDetection
.
IsIcuGlobalization
;
private
static
bool
NotWasmWithIcu
=>
PlatformDetection
.
IsNotBrowser
&&
PlatformDetection
.
IsIcuGlobalization
&&
PlatformDetection
.
IsNotWindowsServerCore
;
[
InlineData
(
"zh-TW-u-co-zhuyin"
,
"zh-TW"
,
"zh-TW_zhuyin"
)]
[
InlineData
(
"de-DE-u-co-phonebk"
,
"de-DE"
,
"de-DE_phoneboo"
)]
...
...
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs
浏览文件 @
1e343258
...
...
@@ -10,20 +10,21 @@ public class NumberFormatInfoCurrencyGroupSizes
{
public
static
IEnumerable
<
object
[
]>
CurrencyGroupSizes_TestData
()
{
yield
return
new
object
[]
{
NumberFormatInfo
.
InvariantInfo
,
new
int
[]
{
3
}
};
yield
return
new
object
[]
{
CultureInfo
.
GetCultureInfo
(
"en-US"
).
NumberFormat
,
new
int
[]
{
3
}
};
yield
return
new
object
[]
{
NumberFormatInfo
.
InvariantInfo
,
new
int
[]
{
3
}
,
null
};
yield
return
new
object
[]
{
CultureInfo
.
GetCultureInfo
(
"en-US"
).
NumberFormat
,
new
int
[]
{
3
}
,
null
};
if
(
PlatformDetection
.
IsNotUsingLimitedCultures
&&
!
PlatformDetection
.
IsUbuntu
&&
!
PlatformDetection
.
IsWindows7
&&
!
PlatformDetection
.
IsWindows8x
&&
!
PlatformDetection
.
IsFedora
)
{
yield
return
new
object
[]
{
CultureInfo
.
GetCultureInfo
(
"ur-IN"
).
NumberFormat
,
new
int
[]
{
3
,
2
}
};
yield
return
new
object
[]
{
CultureInfo
.
GetCultureInfo
(
"ur-IN"
).
NumberFormat
,
new
int
[]
{
3
,
2
}
,
new
int
[]
{
3
}
};
}
}
[
Theory
]
[
MemberData
(
nameof
(
CurrencyGroupSizes_TestData
))]
public
void
CurrencyGroupSizes_Get_ReturnsExpected
(
NumberFormatInfo
format
,
int
[]
expected
)
public
void
CurrencyGroupSizes_Get_ReturnsExpected
(
NumberFormatInfo
format
,
int
[]
expected
,
int
[]
expectedAlternative
)
{
Assert
.
Equal
(
expected
,
format
.
CurrencyGroupSizes
);
Assert
.
True
(
format
.
CurrencyGroupSizes
.
AsSpan
().
SequenceEqual
(
expected
.
AsSpan
())
||
format
.
CurrencyGroupSizes
.
AsSpan
().
SequenceEqual
(
expectedAlternative
.
AsSpan
()),
$"Expected
{
string
.
Join
(
", "
,
expected
)}
or
{
string
.
Join
(
", "
,
expectedAlternative
??
Array
.
Empty
<
int
>())}
, got
{
string
.
Join
(
", "
,
format
.
CurrencyGroupSizes
)}
"
);
}
[
Theory
]
...
...
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.cs
浏览文件 @
1e343258
...
...
@@ -54,8 +54,6 @@ public static IEnumerable<object[]> DigitSubstitution_TestData()
yield
return
new
object
[]
{
"nqo-GN"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"pa-Arab"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"pa-Arab-PK"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"prs"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"prs-AF"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"ps"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"ps-AF"
,
DigitShapes
.
NativeNational
};
yield
return
new
object
[]
{
"sd"
,
DigitShapes
.
NativeNational
};
...
...
@@ -115,5 +113,22 @@ public void DigitSubstitutionListTest(string cultureName, DigitShapes shape)
}
}
[
Theory
]
[
InlineData
(
"prs"
)]
[
InlineData
(
"prs-AF"
)]
public
void
PrsNativeDigitsTest
(
string
cultureName
)
{
try
{
CultureInfo
ci
=
CultureInfo
.
GetCultureInfo
(
cultureName
);
// Some OS's set the DigitSubstitution to Context for the culture "prs" and "prs-AF". Majority of Os's set it to NativeNational.
Assert
.
True
(
ci
.
NumberFormat
.
DigitSubstitution
==
DigitShapes
.
Context
||
ci
.
NumberFormat
.
DigitSubstitution
==
DigitShapes
.
NativeNational
);
}
catch
(
CultureNotFoundException
)
{
// ignore the cultures that we cannot create as it is not supported on the platforms
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录