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

Unified Diff: compiler/javatests/com/google/dart/compiler/IdeTest.java

Issue 10021017: Adds parser recovery for type parameters and type arguments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updates for completion to work Created 8 years, 8 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
Index: compiler/javatests/com/google/dart/compiler/IdeTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/IdeTest.java b/compiler/javatests/com/google/dart/compiler/IdeTest.java
index a83fd19285e30960224e65bf28f8c3345af91c48..198a14554df52b6d26f4928f7bc23b8ec7a44f7f 100644
--- a/compiler/javatests/com/google/dart/compiler/IdeTest.java
+++ b/compiler/javatests/com/google/dart/compiler/IdeTest.java
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -54,9 +54,9 @@ public class IdeTest extends TestCase {
private final DartCompilerListener listener = context;
- private DartArtifactProvider provider = new TestDartArtifactProvider();
+ private final DartArtifactProvider provider = new TestDartArtifactProvider();
- private CompilerConfiguration config = new TestCompilerConfiguration();
+ private final CompilerConfiguration config = new TestCompilerConfiguration();
public void testAnalyseNoSemicolonPropertyAccess() {
DartUnit unit =
@@ -160,10 +160,12 @@ public class IdeTest extends TestCase {
"}");
// Expected identifier and missing semicolon.
assertEquals("errorCount", 2, context.getErrorCount());
- assertEquals("typeErrorCount", 1, context.getTypeErrorCount()); // void cannot be resolved.
+ // You can't use 'void' as a member name. It might be the beginning of a variable declaration
+ // so it isn't an error in and of itself.
+ assertEquals("typeErrorCount", 0, context.getTypeErrorCount());
DartExprStmt statement = (DartExprStmt) firstStatementOfMethod(unit, "Foo", "foo");
DartIdentifier expression = (DartIdentifier) statement.getExpression();
- assertEquals("void", expression.getName());
+ assertEquals("", expression.getName());
}
public void testAnalyseVoidKeywordPropertyAccess() {
@@ -178,10 +180,10 @@ public class IdeTest extends TestCase {
"}");
// Expected identifier and missing semicolon.
assertEquals("errorCount", 2, context.getErrorCount());
- assertEquals("typeErrorCount", 1, context.getTypeErrorCount()); // No member "void".
+ assertEquals("typeErrorCount", 1, context.getTypeErrorCount());
DartExprStmt statement = (DartExprStmt) firstStatementOfMethod(unit, "Foo", "foo");
DartPropertyAccess expression = (DartPropertyAccess) statement.getExpression();
- assertEquals("void", expression.getPropertyName());
+ assertEquals("", expression.getPropertyName());
}
public void testReturnIntTypeAnalysis() {

Powered by Google App Engine
This is Rietveld 408576698