| xtext-utils - integration test failing, whitespace mismatch? [message #754604] |
Thu, 03 November 2011 09:25  |
Scott Finnie Messages: 56 Registered: October 2011 |
Member |
|
|
Integration test failing and I'm not sure why. Error is:
org.junit.ComparisonFailure: expected:<Domain "Banking" {[]}> but was:<Domain "Banking" {[ ]}>
So only difference appears to be whitespace?
The source file was created using the generated xtext editor and shows no validation errors in the IDE. Here's the file:
And the relevant grammar rule:
Domain:
'Domain' name=String '{'
(elements+=ModelElement)*
'}';
The test passes if I change the input to:
i.e. add space between braces...?
thx.
[Updated on: Thu, 03 November 2011 09:31] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
| Re: xtext-utils - integration test failing, whitespace mismatch? [message #1003230 is a reply to message #754672] |
Sun, 20 January 2013 12:50  |
Nathan M Messages: 5 Registered: January 2013 |
Junior Member |
|
|
The problem I am having is the when running the test, the formatter is using the default one (IIndentationInformation.Default) which always uses a literal tab character. But the actual default xtext implementation is PreferenceStoreIndentationInformation.java, which uses the eclipse preference. So the eclipse preference can be set to use spaces, and so the test file gets formatted as such, but then the serialization comparison fails because it's expecting a tab instead of spaces.
So is there a way to make the formatter used in the test use the PreferenceStoreIndentationInformation class instead?
|
|
|
Powered by
FUDForum. Page generated in 0.02015 seconds