| author | szarnekow | 2009-02-17 11:23:21 (EST) |
|---|---|---|
| committer | sefftinge | 2009-02-17 11:23:21 (EST) |
| commit | a388eadbff995aca6acd73f0400c70da5d042ccf (patch) (side-by-side diff) | |
| tree | 80c96f1407baaa611b2756d4f044eb3007d06e02 | |
| parent | ef54768acc3bdf5bd826538df94289dc5c26306b (diff) | |
| download | org.eclipse.xtext-a388eadbff995aca6acd73f0400c70da5d042ccf.zip org.eclipse.xtext-a388eadbff995aca6acd73f0400c70da5d042ccf.tar.gz org.eclipse.xtext-a388eadbff995aca6acd73f0400c70da5d042ccf.tar.bz2 | |
Fix: Language Inhertiance has Problem with Alternatives and References (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=265111)
| -rw-r--r-- | tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/Bug265111Test.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/Bug265111Test.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/Bug265111Test.java new file mode 100644 index 0000000..0234f2b --- a/dev/null +++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/Bug265111Test.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.xtext.grammarinheritance; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.xtext.Grammar; +import org.eclipse.xtext.XtextStandaloneSetup; +import org.eclipse.xtext.junit.AbstractXtextTests; + +/** + * @author Sebastian Zarnekow - Initial contribution and API + */ +public class Bug265111Test extends AbstractXtextTests { + + @Override + protected void setUp() throws Exception { + super.setUp(); + with(XtextStandaloneSetup.class); + } + + public void testParseGrammar() throws Exception { + String grammar = "language test extends org.eclipse.xtext.grammarinheritance.BaseInheritanceTestLanguage\n" + + "generate test 'http://test'\n" + + "Root: A | Model;" + + "A: 'A' name=ID;"; + Resource r = getResourceFromString(grammar); + Grammar g = (Grammar) r.getContents().get(0); + assertEquals("test", g.getName()); + assertEquals(r.getErrors().toString(), 1, r.getErrors().size()); + + } +} |

