zrrk / xtext-utils

Automatically exported from code.google.com/p/xtext-utils
0 stars 0 forks source link

Allow option to ignore OS-specific newLine differences #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a file (in your own DSL) using eclipse text editor,
   such that line wraps are created using "\n\r" (Windows), or "\r" (MAC OS 9)
2. Run a test that includes the default serialization check
3. Comparison fails due to line break differences

What is the expected output? What do you see instead?
The comparison should either (1) consistently use the line-wrap default for the 
platform, or (2) allow a way to specify that differences should be ignored

What version of the product are you using? On what operating system?
0.9.2, Windows 7 x64

**This issue *can* be alleviated by explicitly setting the line-wrap in Eclipse 
to use "Unix" [General=>Workspace=>"New text file line delimiter"]...this might 
be a better practice anyway, but some may not want to change this setting

Original issue reported on code.google.com by matt.deb...@gmail.com on 29 Dec 2011 at 6:59

GoogleCodeExporter commented 9 years ago
Note: ignoring differences was easily achieved by extending the testFile 
method, and injecting the following code just before the assertEquals(...) call:
expected = expected.replaceAll("(\r\n|\r)", "\n");
serialized = serialized.replaceAll("(\r\n|\r)", "\n");

Original comment by matt.deb...@gmail.com on 29 Dec 2011 at 7:01

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 1c7c4c55da29.

Original comment by karsten....@googlemail.com on 26 Apr 2012 at 11:25