| 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 {
|
|
|