aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-03-06 10:53:17 (EST)
committersefftinge2009-03-06 10:53:17 (EST)
commitbf1669175c36f9ce4f13c9938869193603a1e4a1 (patch)
tree6b80b06fc7bfe8ac9c09410a04b5407f76738a7b
parentac9f510462aad3c84a63eee9525d346a5d88f4a8 (diff)
downloadorg.eclipse.xtext-bf1669175c36f9ce4f13c9938869193603a1e4a1.zip
org.eclipse.xtext-bf1669175c36f9ce4f13c9938869193603a1e4a1.tar.gz
org.eclipse.xtext-bf1669175c36f9ce4f13c9938869193603a1e4a1.tar.bz2
Fix: Disallow rulenames that are equalIgnoreCase (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=263141)
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/XtextValidationTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/XtextValidationTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/XtextValidationTest.java
index 97b9ac9..59d7930 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/XtextValidationTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/XtextValidationTest.java
@@ -59,4 +59,18 @@ public class XtextValidationTest extends AbstractGeneratorTest {
assertEquals(child.getData().toString(), 2, child.getData().size());
}
+ public void testRulenamesAreNotEqualIgnoreCase() throws Exception {
+ XtextResource resource = getResourceFromString(
+ "grammar org.foo.Bar with org.eclipse.xtext.common.Terminals\n" +
+ "generate metamodel 'myURI'\n" +
+ "Model: name=ID ref=[Model|(ID)];\n" +
+ "moDel: name=ID ref='foo';");
+ assertTrue(resource.getErrors().toString(), resource.getErrors().isEmpty());
+ assertTrue(resource.getWarnings().toString(), resource.getWarnings().isEmpty());
+
+ Diagnostic diag = Diagnostician.INSTANCE.validate(resource.getContents().get(0));
+ assertNotNull("diag", diag);
+ assertEquals(diag.getChildren().toString(), 2, diag.getChildren().size());
+ assertEquals("diag.isError", diag.getSeverity(), Diagnostic.ERROR);
+ }
}