mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.51k stars 898 forks source link

Test for Complex32TextHandling fails on machine with culture "de-DE" #586

Open TobiasGlaubach opened 6 years ago

TobiasGlaubach commented 6 years ago

Test fails when running build.cmd from PowerShell (Windows 10). Issue came from this discussion.

Thats the error:

1) Failed : MathNet.Numerics.UnitTests.ComplexTests.Complex32TextHandlingTest.CanFormatComplexToStringWithCulture("de-DE","1,1")
  String lengths are both 8. Strings differ at index 2.
  Expected: "(1,1, 0)"
  But was:  "(1.1, 0)"
  -------------^
   at MathNet.Numerics.UnitTests.ComplexTests.Complex32TextHandlingTest.CanFormatComplexToStringWithCulture(String cultureName, String number) in C:\Users\#####\mathnet-numerics\src\Numerics.Tests\ComplexTests\Complex32Test.TextHandling.cs:line 96

Thats my System CurrentCulture:

Thread.CurrentThread.CurrentCulture
[de-DE]

Thats my NumberFormant:

Thread.CurrentThread.CurrentCulture.NumberFormat
NumberFormatInfo { CurrencyDecimalDigits=2, CurrencyDecimalSeparator=",", CurrencyGroupSeparator=".", CurrencyGroupSizes=int[1] { 3 }, CurrencyNegativePattern=8, CurrencyPositivePattern=3, CurrencySymbol="€", DigitSubstitution=None, IsReadOnly=true, NaNSymbol="NaN", NativeDigits=string[10] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }, NegativeInfinitySymbol="-∞", NegativeSign="-", NumberDecimalDigits=2, NumberDecimalSeparator=".", NumberGroupSeparator=" ", NumberGroupSizes=int[1] { 3 }, NumberNegativePattern=1, PercentDecimalDigits=2, PercentDecimalSeparator=".", PercentGroupSeparator=" ", PercentGroupSizes=int[1] { 3 }, PercentNegativePattern=0, PercentPositivePattern=0, PercentSymbol="%", PerMilleSymbol="‰", PositiveInfinitySymbol="∞", PositiveSign="+" }
TobiasGlaubach commented 6 years ago

Ok, when I run it in the VS-2017 Test Explorer, the test succedes. So it might be related to the culture of the Build script.

TobiasGlaubach commented 6 years ago

I ran the build.cmd in PowerShell as well as in cmd.exe -> Both fail.

cdrnet commented 6 years ago

Thanks for reporting this!