Closed Psyches closed 8 years ago
That is, the 7 failures are 2 hard-coded string tests with embedded line delimiters (the first and last), and 5 character encoding tests all in a single JUnit test class (separated by method name). I didn't dig into the 5, which are all strictly bytesWritten differences (all line counts etc are correct).
FYI, I've worked around these locally. In the Encoding tests:
private final boolean isLongEOL = System.getProperty("line.separator").length() > 1;
and then in the bytesWritten assert, something like (this one for bigEndianUnicode):
assertEquals(isLongEOL ? (1203626 + 20022 * 2) : 1203626, bytesWritten);
for the String hard-codes compared with file Writer output, e.g. Issue97Test:
String output = baos.toString().replaceAll("\r", "");
Those seem like good and reasonable fixes - can you submit a pull request with those changes?
It's actually worse than this. A number of well-formed files won't load under Windows. Because the code was written on a Mac system, it doesn't correctly handle line terminators for Windows in a number of locations. I will be working on this soon.
I've corrected things so they work on Mac and Windows.
To do so, I did have to introduce a new property on GedcomWriter that lets you set the style of line terminator you want (and passes it through to GedcomFileWriter which already had a property for this, but it wasn't exposed to callers). This backward-compatible API change is going to require changing the version number to 3.1.0.
v3.1.0-SNAPSHOT released to Maven Central
v3.1.0 released.
Here are the failing tests that seem to be Windows-related, with some failure results:
org.gedcom4j.writer.Issue89Test:testIssue89(org.gedcom4j.writer.Issue89Test)
...
testNoCancellationAnsel(org.gedcom4j.writer.GedcomWriterFileProgressAndCancellationTest)
testNoCancellationAscii(org.gedcom4j.writer.GedcomWriterFileProgressAndCancellationTest)
testNoCancellationUtf8(org.gedcom4j.writer.GedcomWriterFileProgressAndCancellationTest)
testNoCancellationUnicodeBigEndian(org.gedcom4j.writer.GedcomWriterFileProgressAndCancellationTest)
org.gedcom4j.writer.Issue97Test:testIssue97(org.gedcom4j.writer.Issue97Test)
...