Bug 68635 - POI unit tests fail when run under non-US locale
Summary: POI unit tests fail when run under non-US locale
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-16 12:33 UTC by Axel Howind
Modified: 2024-02-17 15:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Howind 2024-02-16 12:33:55 UTC
POI unit tests fail when run under non-US locale. There already is a check for this that tells what JVM flags to set to make the tests pass. However, the tests should IMHO run "out of the box", as this also might frustrate new contributors when a clean checkout and build fails for no apparent reason (the check for the locale settings is done after several tests have already failed so it's easy to overlook):

      Test testTextStrangeFormat() FAILED
      org.opentest4j.AssertionFailedError: expected: <--123456.7891> but was: <--123456,7891>
          at org.apache.poi.ss.formula.functions.TestText.testText(TestText.java:286)
    
      Test testTextEmptyStringWithDateFormat() PASSED
      Test testTextErrorAsFormat() PASSED
      Test testTextBlankTreatedAsZero() FAILED
      org.opentest4j.AssertionFailedError: expected: <0.000> but was: <0,000>
          at org.apache.poi.ss.formula.functions.TestText.testText(TestText.java:286)
    
      Test testTextErrorAsValue() PASSED
      Test testTextWithDateFormatSecondArg() PASSED
      Test testTextVariousValidNumberFormats() FAILED
      org.opentest4j.AssertionFailedError: expected: <-123456.789> but was: <-123456,789>
          at org.apache.poi.ss.formula.functions.TestText.testText(TestText.java:286)

I will prepare and commit the necessary change.
Comment 1 Axel Howind 2024-02-17 15:53:47 UTC
fixed in r1915827