Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java

Issue 9430013: Issue 1738. Check type of DartMethodDeclaration.getName(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiler/java/com/google/dart/compiler/ast/DartUnit.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
index 1b407a941aa4528646ae7e6697b3005c34404e0f..ec0bb1ea7b0be5a4f305ae93a4860d02806af441 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
@@ -10,8 +10,10 @@ import com.google.common.base.Joiner;
import com.google.dart.compiler.CompilerTestCase;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartMethodDefinition;
+import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartUnit;
+import java.util.List;
import java.util.Set;
/**
@@ -571,6 +573,26 @@ public class NegativeParserTest extends CompilerTestCase {
}
/**
+ * Test for {@link DartUnit#getTopDeclarationNames()} and qualified top-level method name.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=1738
+ */
+ public void test_getTopDeclarationNames_badName() throws Exception {
+ DartParserRunner parserRunner =
+ parseSource(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "void my.method() {}",
+ ""));
+ DartUnit unit = parserRunner.getDartUnit();
+ // We have top-level node...
+ List<DartNode> topLevelNodes = unit.getTopLevelNodes();
+ assertEquals(1, topLevelNodes.size());
+ // ...but it has wrong name, so ignored.
+ Set<String> names = unit.getTopDeclarationNames();
+ assertEquals(0, names.size());
+ }
+
+ /**
* Test for {@link DartUnit#getDeclarationNames()}.
*/
public void test_getDeclarationNames() throws Exception {
« no previous file with comments | « compiler/java/com/google/dart/compiler/ast/DartUnit.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698