[junit4/parameterized] use pipe insted of exclamation mark to match offsets

(cherry picked from commit a38c8f4bc7c5feab7c80f63b733dc271865d1ffb)
This commit is contained in:
Moritz Eysholdt 2011-11-10 11:31:39 +01:00
parent 9f3b84aec5
commit 1add44adfb
3 changed files with 4 additions and 4 deletions

View file

@ -196,7 +196,7 @@ public class XpectParameterProvider implements IParameterProvider {
protected Iterable<Object> convertValue(XtextResource res, INode ctx, int offset, Token token, String value) {
switch (token) {
case OFFSET:
int add = value.indexOf('!');
int add = value.indexOf('|');
if (add >= 0)
value = value.substring(0, add) + value.substring(add + 1);
else

View file

@ -23,8 +23,8 @@ import "http://www.eclipse.org/emf/2002/Ecore" as ecore
xxx yyy zzz
--- */
// XPECT select1 from fo!o to b!az --> o='val' bar='val1' b
// XPECT select2 from fo!o to b!az --> o='val' bar='val1' b
// XPECT select1 from fo|o to b|az --> o='val' bar='val1' b
// XPECT select2 from fo|o to b|az --> o='val' bar='val1' b
Root:
foo='val' bar='val1' baz='xxx'

View file

@ -422,7 +422,7 @@ public class XpectParameterProviderTest
@Test
public void xpectMLOffsetParameter2()
{
String model = "/* XPECT offsetMeth at fo!o --> exp \n*/ Bar: val='foo';";
String model = "/* XPECT offsetMeth at fo|o --> exp \n*/ Bar: val='foo';";
Assert.assertEquals(
"offsetMeth(myOffset='l='fo!o';\\n ', myOffset=157, offset=' \\n*/ !Bar: ', offset=145, resource)",
params(model));