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

Unified Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 834383005: Don't perform incremental resolution if curly brackets are not balanced. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: pkg/analyzer/test/generated/incremental_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index b45db86ce3a9f3afbb44bc595450aec7d88e6f6e..0cee5cf9c627f9ea588f02367a1b29ec4dc03e27 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -2789,6 +2789,58 @@ bb() {}
''', expectedSuccess: false);
}
+ void test_false_unbalancedCurlyBrackets_inNew() {
+ _resolveUnit(r'''
+class A {
+ aaa() {
+ if (true) {
+ 1;
+ }
+ }
+
+ bbb() {
+ print(0123456789);
+ }
+}''');
+ _updateAndValidate(r'''
+class A {
+ aaa() {
+ 1;
+ }
+ }
+
+ bbb() {
+ print(0123456789);
+ }
+}''', expectedSuccess: false);
+ }
+
+ void test_false_unbalancedCurlyBrackets_inOld() {
+ _resolveUnit(r'''
+class A {
+ aaa() {
+ 1;
+ }
+ }
+
+ bbb() {
+ print(0123456789);
+ }
+}''');
+ _updateAndValidate(r'''
+class A {
+ aaa() {
+ if (true) {
+ 1;
+ }
+ }
+
+ bbb() {
+ print(0123456789);
+ }
+}''', expectedSuccess: false);
+ }
+
void test_fieldClassField_propagatedType() {
_resolveUnit(r'''
class A {
@@ -3348,17 +3400,19 @@ f3() {
// Resolve "newCode" from scratch.
if (compareWithFull) {
_resetWithIncremental(false);
+ source = addSource(newCode + ' ');
source = addSource(newCode);
_runTasks();
LibraryElement library = resolve(source);
CompilationUnit fullNewUnit = resolveCompilationUnit(source, library);
+ // Validate tokens.
+ _assertEqualTokens(newUnit, fullNewUnit);
// Validate that "incremental" and "full" units have the same resolution.
try {
assertSameResolution(newUnit, fullNewUnit, validateTypes: true);
} on IncrementalResolutionMismatch catch (mismatch) {
fail(mismatch.message);
}
- _assertEqualTokens(newUnit, fullNewUnit);
List<AnalysisError> newFullErrors =
analysisContext.getErrors(source).errors;
_assertEqualErrors(newErrors, newFullErrors);
@@ -3367,6 +3421,7 @@ f3() {
}
static void _assertEqualToken(Token incrToken, Token fullToken) {
+// print('[${incrToken.offset}] |$incrToken| vs. [${fullToken.offset}] |$fullToken|');
expect(incrToken.type, fullToken.type);
expect(incrToken.offset, fullToken.offset);
expect(incrToken.length, fullToken.length);

Powered by Google App Engine
This is Rietveld 408576698