-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BigInteger] Parse test with trailing spaces fails on some cultures #14545
Comments
This fixes a bunch of tests which fail due to decimal separator is not a dot (#1491). But test method still disabled due to #1642
This fixes a bunch of tests which fail due to decimal separator is not a dot (#1491). But test method still disabled due to #1642
Looks like we know what needs to happen here. It is a simple fix that would be a great place to start looking at the CoreFx code. |
I'm looking for an opportunity to get started contributing to .NET Core. Would it be possible to get this issue assigned to me? |
Sure! I'll try to give you an updated set of instructions to use to repro this. Since this was filed so long ago (almost 2 years), we're not even sure if it still repros. Chances are it still does, though, because none of us run the tests in a Ukrainian environment as far as I know. Steps:
If you then want to repro the individual test project that is failing, you can run
|
@karelz I think we need to add @dennisdietrich to the "Contributors" group before I can assign him any issues. How do we do that, again? |
Invitation sent (you need super-powers in dotnet org to make it happen). |
Thanks @karelz! Done. |
@mellinoe, quick question (I'm sure this is documented somewhere but I can't find it): What about line endings? Should they be Windows or UNIX-style/what value is preferred for core.autocrlf? |
True, I believe. TBH I've never actively thought of this; we use the default as far as I know. |
@mellinoe, the good news (I guess) is that I can repro the issue. Unfortunately, so far I'm unable to build System.Runtime.Numerics.sln in VS (trying to get help on Gitter). |
Still stuck trying to build/debug corefx in VS so it's difficult to do a root cause analysis. However, since I can reproduce on the command line I've looked at the stack trace and so far this looks like a legitimate product bug to me (though it is labeled 'test bug'). First of all, the test passes for invariant, en-US, de-DE, and hi-IN. Second, it chokes on trailing 0x20 characters for uk-UA which is just a regular space. Edit: Checked CultureInfo.NumberFormat for uk-UA but that just seems to confirm my result so far. It is using whitespace characters in a few places but those are 0xA0 and not 0x20. |
N/m. Found this method in FormatProvider.Number so I guess this is by-design and it's interpreting the trailing 0x20 as a trailing group separator. Preparing a PR on the basis of this assumption. private static unsafe char* MatchChars(char* p, char* str)
{
Debug.Assert(p != null && str != null);
if (*str == '\0')
{
return null;
}
// We only hurt the failure case
// This fix is for French or Kazakh cultures. Since a user cannot type 0xA0 as a
// space character we use 0x20 space character instead to mean the same.
while (*p == *str || (*str == '\u00a0' && *p == '\u0020'))
{
p++;
str++;
if (*str == '\0') return p;
}
return null;
} |
Can you provide some details? Maybe @weshaggard @mellinoe can help ... |
Already discussing this with Eric on Gitter (seemed like the better place for figuring this out). Thanks! |
* Fixed BigInteger test failure for uk-UA BigInteger string parsing test was faulty for cultures that use 0xA0 as the group separator. The fixed test does not expect an exception anymore if: - The trailing whitespace is 0x20 characters only AND - Grouping is allowed (NumberStyles.AllowThousands) AND - Currency symbol is allowed and currency group separator is 0xA0 OR Currency symbol is not allowed and number group separator is 0xA0 Fix #1642 * Additional inline code documentation Added comment to FailureNotExpectedForTrailingWhite(NumberStyles, bool) in System.Numerics.Tests.parseTest explaining the need for/function of that method. Fix #1642
Repro steps:
build /p:WithCategories=OuterLoop
Possible solution: dotnet/corefx#1592 (comment)
The text was updated successfully, but these errors were encountered: