-
Notifications
You must be signed in to change notification settings - Fork 146
Description
The main cause of unit test failures is that System.lineSeparator()
is \r\n
which is 2 characters instead of the UNIX line separator \n
which is a single character.
So, if you create a TextAnnotation in UNIX*, the offset will not match on Windows. (This causes unit tests that try to match character offsets fail). Main usage: https://github.com/IllinoisCogComp/illinois-cogcomp-nlp/blob/master/core-utilities/src/main/java/edu/illinois/cs/cogcomp/annotation/BasicTextAnnotationBuilder.java#L56
One way to fix this is to define a \n
as a platform agnostic line separator and use it in all strings that we use. Essentially assuming all edits to data are done on UNIX* systems.
Other option is to force System.lineSeparator()
on Windows to \n
. This can be done programmatically or through environment variable. https://stackoverflow.com/questions/22681534/java-change-system-new-line-character