Skip to content

Commit 19f1e34

Browse files
committed
Add regression test
1 parent db0c284 commit 19f1e34

File tree

1 file changed

+27
-0
lines changed
  • src/libraries/System.Runtime.Numerics/tests/BigInteger

1 file changed

+27
-0
lines changed

src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,33 @@ public void Parse_Hex32Bits()
154154
});
155155
}
156156

157+
public static IEnumerable<object[]> RegressionIssueRuntime94610_TestData()
158+
{
159+
yield return new object[]
160+
{
161+
new string('9', 865),
162+
};
163+
164+
yield return new object[]
165+
{
166+
new string('9', 20161),
167+
};
168+
}
169+
170+
[Theory]
171+
[MemberData(nameof(RegressionIssueRuntime94610_TestData))]
172+
public void RegressionIssueRuntime94610(string text)
173+
{
174+
// Regression test for: https://github.com/dotnet/runtime/issues/94610
175+
Test();
176+
BigIntTools.Utils.RunWithFakeThreshold(Number.s_naiveThreshold, 0, Test);
177+
178+
void Test()
179+
{
180+
VerifyParseToString(text, NumberStyles.Integer, true);
181+
}
182+
}
183+
157184
private static void RunFormatProviderParseStrings()
158185
{
159186
NumberFormatInfo nfi = new NumberFormatInfo();

0 commit comments

Comments
 (0)