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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1833823002: Add tests for summarizing / resynthesizing using only AST. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | pkg/analyzer/test/src/summary/test_all.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 9dc82a1dbc6b3c02f7c93a106d4406e6e3ccb946..3d0faa41eeeb7626fbd422f5f767f32eb47876e7 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -3338,6 +3338,7 @@ int foo() => 0;
expect(parameter.kind, UnlinkedParamKind.named);
expect(parameter.initializer, isNotNull);
expect(parameter.defaultValueCode, '42');
+ _assertCodeRange(parameter.codeRange, 13, 10);
_assertUnlinkedConst(parameter.defaultValue,
operators: [UnlinkedConstOperation.pushInt], ints: [42]);
}
@@ -3369,6 +3370,7 @@ int foo() => 0;
expect(parameter.kind, UnlinkedParamKind.positional);
expect(parameter.initializer, isNotNull);
expect(parameter.defaultValueCode, '42');
+ _assertCodeRange(parameter.codeRange, 13, 11);
_assertUnlinkedConst(parameter.defaultValue,
operators: [UnlinkedConstOperation.pushInt], ints: [42]);
}
@@ -3413,6 +3415,7 @@ class C {
expect(executable.nameOffset, text.indexOf('foo'));
expect(executable.periodOffset, text.indexOf('.foo'));
expect(executable.nameEnd, text.indexOf('()'));
+ _assertCodeRange(executable.codeRange, 10, 8);
}
test_constructor_non_const() {
@@ -4521,6 +4524,14 @@ get g { // 1
expect(executable.isExternal, false);
}
+ test_executable_operator_abstract() {
+ UnlinkedExecutable executable =
+ serializeClassText('class C { C operator+(C c); }', allowErrors: true)
+ .executables[0];
+ expect(executable.isAbstract, true);
+ expect(executable.isExternal, false);
+ }
+
test_executable_operator_equal() {
UnlinkedExecutable executable = serializeClassText(
'class C { bool operator==(Object other) => false; }')
@@ -4532,6 +4543,7 @@ get g { // 1
UnlinkedExecutable executable =
serializeClassText('class C { external C operator+(C c); }')
.executables[0];
+ expect(executable.isAbstract, false);
expect(executable.isExternal, true);
}
@@ -4677,6 +4689,7 @@ int foo(int a, String b) => 0;
expect(param.kind, UnlinkedParamKind.named);
expect(param.initializer, isNotNull);
expect(param.defaultValueCode, '42');
+ _assertCodeRange(param.codeRange, 3, 5);
_assertUnlinkedConst(param.defaultValue,
operators: [UnlinkedConstOperation.pushInt], ints: [42]);
}
@@ -4696,6 +4709,7 @@ int foo(int a, String b) => 0;
expect(param.kind, UnlinkedParamKind.positional);
expect(param.initializer, isNotNull);
expect(param.defaultValueCode, '42');
+ _assertCodeRange(param.codeRange, 3, 6);
_assertUnlinkedConst(param.defaultValue,
operators: [UnlinkedConstOperation.pushInt], ints: [42]);
}
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | pkg/analyzer/test/src/summary/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698