epam/parso

Decimal separator issue

Closed this issue · 1 comments

I tried to run all tests using mvn clean install but ran into the following issue:
org.junit.ComparisonFailure: expected:<...pctincr number 5 : 0[.]0%'> but was:<...pctincr number 5 : 0[,]0%'>

I suspect this is because the locale I am using "Sweden" have ',' as the decimal separator instead of the commonly used '.'

Probably a system default decimal separator is used somewhere comparing it to some fixed decimal format...

Here is the full stacktrace:

[main] INFO com.epam.parso.SasFileReaderUnitTest - Processing file sas7bdat//test-columnar.sas7bdat
testData(com.epam.parso.CSVDataWriterUnitTest) Time elapsed: 1.275 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<...pctincr number 5 : 0[.]0%'> but was:<...pctincr number 5 : 0[,]0%'>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.fest.assertions.ConstructorInvoker.newInstance(ConstructorInvoker.java:36)
at org.fest.assertions.ComparisonFailureFactory.newComparisonFailure(ComparisonFailureFactory.java:60)
at org.fest.assertions.ComparisonFailureFactory.comparisonFailure(ComparisonFailureFactory.java:46)
at org.fest.assertions.Fail.comparisonFailed(Fail.java:83)
at org.fest.assertions.Fail.failIfNotEqual(Fail.java:71)
at org.fest.assertions.GenericAssert.isEqualTo(GenericAssert.java:217)
at com.epam.parso.SasFileReaderUnitTest.compareResultWithControl(SasFileReaderUnitTest.java:318)
at com.epam.parso.SasFileReaderUnitTest.testData(SasFileReaderUnitTest.java:166)
at com.epam.parso.CSVDataWriterUnitTest.testData(CSVDataWriterUnitTest.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Hi @perNyfelt , thanks for reporting this issue. Currently the problem with decimal separator is fixed in the master branch and it will be included in the next release.