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

Unified Diff: dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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: dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
diff --git a/dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java b/dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
index 02ef841912807a5e61649ee6916253652b9fe84a..89dcb1564538febfb1b4a0899bbd534b3f1e9b46 100644
--- a/dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
+++ b/dart/compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java
@@ -91,9 +91,9 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"part 'B.dart';",
"part 'C.dart';",
""));
- appSource.setContent("A.dart", "part of application;");
- appSource.setContent("B.dart", "part of application;");
- appSource.setContent("C.dart", "part of application;");
+ appSource.setContent("A.dart", "");
+ appSource.setContent("B.dart", "");
+ appSource.setContent("C.dart", "");
}
@Override
@@ -114,7 +114,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" int not_hole;",
"}",
@@ -123,7 +122,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"C.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" int bar() {",
" return super.not_hole;", // qualified reference
@@ -137,7 +135,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"int not_hole;",
""));
compile();
@@ -160,7 +157,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" int foo() {",
" return hole;", // no such field
@@ -168,13 +164,12 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"}",
""));
compile();
- assertErrors(errors, errEx(TypeErrorCode.CANNOT_BE_RESOLVED, 5, 12, 4));
+ assertErrors(errors, errEx(TypeErrorCode.CANNOT_BE_RESOLVED, 4, 12, 4));
// Update units and compile.
appSource.setContent(
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"int hole;",
""));
compile();
@@ -195,7 +190,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" foo() {}",
"}",
@@ -204,7 +198,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"C.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" int bar() {",
" foo();", // unqualified invocation
@@ -219,7 +212,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"foo() {}",
""));
compile();
@@ -234,7 +226,7 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
Thread.sleep(5);
// Remove top-level foo(), so invocation of foo() in B should be bound to the super class.
{
- appSource.setContent("A.dart", "part of application;");
+ appSource.setContent("A.dart", "");
compile();
// B should be compiled because it also declares foo(), so produces "shadow" conflict.
// C should be compiled because it has unqualified invocation which was declared in A.
@@ -253,7 +245,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" foo() {}",
"}",
@@ -262,7 +253,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"C.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" int bar() {",
" super.foo();", // qualified invocation
@@ -277,7 +267,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"foo() {}",
""));
compile();
@@ -299,7 +288,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" var foo;",
"}",
@@ -308,7 +296,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"C.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" int bar() {",
" foo = 0;", // unqualified access
@@ -323,7 +310,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var foo;",
""));
compile();
@@ -338,7 +324,7 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
Thread.sleep(5);
// Remove top-level "foo", so access to "foo" in B should be bound to the super class.
{
- appSource.setContent("A.dart", "part of application;");
+ appSource.setContent("A.dart", "");
compile();
// B should be compiled because it also declares "foo", so produces "shadow" conflict.
// C should be compiled because it has unqualified access which was declared in A.
@@ -357,7 +343,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" var foo;",
"}",
@@ -366,7 +351,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"C.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" int bar() {",
" super.foo = 0;", // qualified access
@@ -381,7 +365,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var foo;",
""));
compile();
@@ -399,7 +382,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"methodB() {",
" var symbolDependency_foo;",
"}"));
@@ -410,7 +392,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var symbolDependency_foo;"));
compile();
// Now there is top-level declarations conflict between A and B.
@@ -425,19 +406,17 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var duplicate;"));
appSource.setContent(
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"bar() {",
" var duplicate;",
"}"));
compile();
// Update units and compile.
- appSource.setContent("A.dart", "part of application;");
+ appSource.setContent("A.dart", "");
compile();
// Top-level declaration in A was removed, so no conflict.
// So:
@@ -455,13 +434,11 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var duplicate;"));
appSource.setContent(
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"bar() {",
" var duplicate;",
"}"));
@@ -488,7 +465,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
"}",
""));
@@ -496,7 +472,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class B extends A {",
" foo() {",
" var bar;",
@@ -510,7 +485,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"class A {",
" var bar;",
"}",
@@ -526,7 +500,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var conflict;",
""));
compile();
@@ -536,7 +509,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"B.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
"var conflict;",
""));
compile();
@@ -544,8 +516,8 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
// Both A and B have errors.
assertErrors(
errors,
- errEx("A.dart", ResolverErrorCode.DUPLICATE_TOP_LEVEL_DECLARATION, 3, 5, 8),
- errEx("B.dart", ResolverErrorCode.DUPLICATE_TOP_LEVEL_DECLARATION, 3, 5, 8));
+ errEx("A.dart", ResolverErrorCode.DUPLICATE_TOP_LEVEL_DECLARATION, 2, 5, 8),
+ errEx("B.dart", ResolverErrorCode.DUPLICATE_TOP_LEVEL_DECLARATION, 2, 5, 8));
}
/**
@@ -825,7 +797,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
"A.dart",
makeCode(
"// filler filler filler filler filler filler filler filler filler filler filler",
- "part of application;",
""));
appSource.setContent(
APP,
@@ -1507,74 +1478,6 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
}
/**
- * Part should have one and only one directive - "part of".
- */
- public void test_partDirectives_otherThenPartOf() throws Exception {
- appSource.setContent(
- "A.dart",
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- "library A;",
- ""));
- appSource.setContent(
- APP,
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- "library application;",
- "part 'A.dart';",
- ""));
- // do compile
- compile();
- assertErrors(errors, errEx(DartCompilerErrorCode.ILLEGAL_DIRECTIVES_IN_SOURCED_UNIT, 2, 1, 10));
- }
-
- /**
- * Part should have one and only one directive - "part of".
- */
- public void test_partDirectives_noPartOf() throws Exception {
- appSource.setContent(
- "A.dart",
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- ""));
- appSource.setContent(
- APP,
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- "library application;",
- "part 'A.dart';",
- ""));
- // do compile
- compile();
- assertErrors(errors, errEx(DartCompilerErrorCode.MISSING_PART_OF_DIRECTIVE, -1, -1, 0));
- }
-
- /**
- * Part should have one and only one directive - "part of".
- */
- public void test_partDirectives_wrongNameInPartOf() throws Exception {
- appSource.setContent(
- "A.dart",
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- "part of Z;",
- ""));
- appSource.setContent(
- APP,
- makeCode(
- "// filler filler filler filler filler filler filler filler filler filler filler",
- "library application;",
- "part 'A.dart';",
- ""));
- // do compile
- compile();
- assertErrors(
- errors,
- errEx(DartCompilerErrorCode.WRONG_PART_OF_NAME, 2, 1, 10),
- errEx(TypeErrorCode.CANNOT_BE_RESOLVED, 2, 9, 1));
- }
-
- /**
* Internals of Dart use "dart-ext:" import scheme, and these libraries are allowed to use
* "native". New import syntax.
*/
@@ -1593,7 +1496,7 @@ public class IncrementalCompilation2Test extends CompilerTestCase {
compile();
assertErrors(errors);
}
-
+
/**
* Internals of Dart use "dart-ext:" import scheme, and these libraries are allowed to use
* "native". Obsolete import syntax.

Powered by Google App Engine
This is Rietveld 408576698