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

Unified Diff: test/codegen/recorder_test.dart

Issue 1016913002: pkg/smoke: support latest analyzer version and formatted code (Closed) Base URL: https://github.com/dart-lang/smoke@master
Patch Set: updates Created 5 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 | « test/codegen/generator_test.dart ('k') | test/codegen/testing_resolver_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/recorder_test.dart
diff --git a/test/codegen/recorder_test.dart b/test/codegen/recorder_test.dart
index 2392116fcb404eccdb4333d3d75bb7dabfd5ade5..2a9fab9994f454630f9a4a1f30dc5b98b90aebd6 100644
--- a/test/codegen/recorder_test.dart
+++ b/test/codegen/recorder_test.dart
@@ -29,16 +29,15 @@ main() {
checkResults(generator,
imports: [
- "import '/a.dart' as smoke_0;",
- "import '/b.dart' as smoke_1;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.A: smoke_1.B,\n'
- ' smoke_0.C: smoke_0.A,\n'
- ' }));\n');
+ "import '/a.dart' as smoke_0;",
+ "import '/b.dart' as smoke_1;",
+ ],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.A: smoke_1.B,\n'
+ ' smoke_0.C: smoke_0.A,\n'
+ ' }));\n');
});
test('single mixin', () {
@@ -46,17 +45,14 @@ main() {
recorder.lookupParent(lib.getType('E'));
checkResults(generator,
- imports: [
- "import '/a.dart' as smoke_0;",
- ],
+ imports: ["import '/a.dart' as smoke_0;",],
topLevel: 'abstract class _M0 {} // A & D1\n',
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.E: _M0,\n'
- ' _M0: smoke_0.A,\n'
- ' }));\n');
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.E: _M0,\n'
+ ' _M0: smoke_0.A,\n'
+ ' }));\n');
});
test('multiple mixins', () {
@@ -64,22 +60,18 @@ main() {
recorder.lookupParent(lib.getType('F'));
checkResults(generator,
- imports: [
- "import '/a.dart' as smoke_0;",
- ],
- topLevel:
- 'abstract class _M0 {} // A & D1\n'
- 'abstract class _M1 {} // _M0 & D2\n'
- 'abstract class _M2 {} // _M1 & D3\n',
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.F: _M2,\n'
- ' _M0: smoke_0.A,\n'
- ' _M1: _M0,\n'
- ' _M2: _M1,\n'
- ' }));\n');
+ imports: ["import '/a.dart' as smoke_0;",],
+ topLevel: 'abstract class _M0 {} // A & D1\n'
+ 'abstract class _M1 {} // _M0 & D2\n'
+ 'abstract class _M2 {} // _M1 & D3\n',
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.F: _M2,\n'
+ ' _M0: smoke_0.A,\n'
+ ' _M1: _M0,\n'
+ ' _M2: _M1,\n'
+ ' }));\n');
});
test('same as common_test', () {
@@ -96,29 +88,25 @@ main() {
recorder.lookupParent(lib.getType('F2'));
recorder.lookupParent(lib.getType('G'));
recorder.lookupParent(lib.getType('H'));
- var coreLib = lib.visibleLibraries.firstWhere(
- (l) => l.displayName == 'dart.core');
+ var coreLib =
+ lib.visibleLibraries.firstWhere((l) => l.displayName == 'dart.core');
recorder.lookupParent(coreLib.getType('int'));
recorder.lookupParent(coreLib.getType('num'));
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- topLevel:
- 'abstract class _M0 {} // C & A\n',
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.AnnotB: smoke_0.Annot,\n'
- ' smoke_0.D: _M0,\n'
- ' smoke_0.E2: smoke_0.E,\n'
- ' smoke_0.F2: smoke_0.F,\n'
- ' smoke_0.H: smoke_0.G,\n'
- ' int: num,\n'
- ' _M0: smoke_0.C,\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ topLevel: 'abstract class _M0 {} // C & A\n',
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.AnnotB: smoke_0.Annot,\n'
+ ' smoke_0.D: _M0,\n'
+ ' smoke_0.E2: smoke_0.E,\n'
+ ' smoke_0.F2: smoke_0.F,\n'
+ ' smoke_0.H: smoke_0.G,\n'
+ ' int: num,\n'
+ ' _M0: smoke_0.C,\n'
+ ' }));\n');
});
});
@@ -126,17 +114,14 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.addStaticMethod(lib.getType('A'), 'sM');
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' staticMethods: {\n'
- ' smoke_0.A: {\n'
- ' #sM: smoke_0.A.sM,\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' staticMethods: {\n'
+ ' smoke_0.A: {\n'
+ ' #sM: smoke_0.A.sM,\n'
+ ' },\n'
+ ' }));\n');
});
group('lookup member', () {
@@ -148,228 +133,191 @@ main() {
test('missing declaration', () {
recorder.lookupMember(lib.getType('A'), 'q', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {},\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {},\n'
+ ' }));\n');
});
test('field declaration', () {
recorder.lookupMember(lib.getType('A'), 'i', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' },\n'
+ ' }));\n');
});
test('sattic field declaration', () {
recorder.lookupMember(lib.getType('A'), 'sI', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #sI: const Declaration(#sI, int, isStatic: true),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #sI: const Declaration(#sI, int, isStatic: true),\n'
+ ' },\n'
+ ' }));\n');
});
test('property declaration', () {
recorder.lookupMember(lib.getType('A'), 'j2', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('static property declaration', () {
recorder.lookupMember(lib.getType('A'), 'sJ', includeAccessors: false);
final details = 'kind: PROPERTY, isFinal: true, isStatic: true';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #sJ: const Declaration(#sJ, int, $details),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #sJ: const Declaration(#sJ, int, $details),\n'
+ ' },\n'
+ ' }));\n');
});
test('field and property of dynamic type', () {
recorder.lookupMember(lib.getType('I'), 'i1', includeAccessors: false);
recorder.lookupMember(lib.getType('I'), 'i2', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.I: {\n'
- ' #i1: const Declaration(#i1, dynamic),\n'
- ' #i2: const Declaration(#i2, dynamic, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.I: {\n'
+ ' #i1: const Declaration(#i1, dynamic),\n'
+ ' #i2: const Declaration(#i2, dynamic, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('property of concrete type', () {
recorder.lookupMember(lib.getType('I'), 'i3', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.I: {\n'
- ' #i3: const Declaration(#i3, smoke_0.G, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.I: {\n'
+ ' #i3: const Declaration(#i3, smoke_0.G, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' },\n'
+ ' }));\n');
});
test('method declaration', () {
recorder.lookupMember(lib.getType('A'), 'inc0', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #inc0: const Declaration(#inc0, Function, kind: METHOD),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #inc0: const Declaration(#inc0, Function, kind: METHOD),\n'
+ ' },\n'
+ ' }));\n');
});
test('static method declaration', () {
recorder.lookupMember(lib.getType('A'), 'sM', includeAccessors: false);
const details = 'kind: METHOD, isStatic: true';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #sM: const Declaration(#sM, Function, $details),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #sM: const Declaration(#sM, Function, $details),\n'
+ ' },\n'
+ ' }));\n');
});
test('inherited field - not recursive', () {
recorder.lookupMember(lib.getType('D'), 'i', includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.D: {},\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.D: {},\n'
+ ' }));\n');
});
test('inherited field - recursive', () {
- recorder.lookupMember(lib.getType('D'), 'i', recursive: true,
- includeAccessors: false);
+ recorder.lookupMember(lib.getType('D'), 'i',
+ recursive: true, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
+ imports: ["import '/common.dart' as smoke_0;",],
topLevel: 'abstract class _M0 {} // C & A\n',
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.D: _M0,\n'
- ' _M0: smoke_0.C,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.D: {},\n'
- ' _M0: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' },\n'
- ' }));\n');
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.D: _M0,\n'
+ ' _M0: smoke_0.C,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.D: {},\n'
+ ' _M0: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' },\n'
+ ' }));\n');
});
test('inherited field - recursive deep', () {
- recorder.lookupMember(lib.getType('J3'), 'i', recursive: true,
- includeAccessors: false);
+ recorder.lookupMember(lib.getType('J3'), 'i',
+ recursive: true, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.J2: smoke_0.J1,\n'
- ' smoke_0.J3: smoke_0.J2,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.J1: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' },\n'
- ' smoke_0.J2: {},\n'
- ' smoke_0.J3: {},\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.J2: smoke_0.J1,\n'
+ ' smoke_0.J3: smoke_0.J2,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.J1: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' },\n'
+ ' smoke_0.J2: {},\n'
+ ' smoke_0.J3: {},\n'
+ ' }));\n');
});
test('inherited field - recursive - includeUpTo', () {
- recorder.lookupMember(lib.getType('J3'), 'i', recursive: true,
- includeAccessors: false, includeUpTo: lib.getType('J1'));
+ recorder.lookupMember(lib.getType('J3'), 'i',
+ recursive: true,
+ includeAccessors: false,
+ includeUpTo: lib.getType('J1'));
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.J2: smoke_0.J1,\n'
- ' smoke_0.J3: smoke_0.J2,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.J2: {},\n'
- ' smoke_0.J3: {},\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.J2: smoke_0.J1,\n'
+ ' smoke_0.J3: smoke_0.J2,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.J2: {},\n'
+ ' smoke_0.J3: {},\n'
+ ' }));\n');
});
});
@@ -379,20 +327,16 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('A'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' #j: const Declaration(#j, int),\n'
- ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
-
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' #j: const Declaration(#j, int),\n'
+ ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('only fields', () {
@@ -400,19 +344,15 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('A'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' #j: const Declaration(#j, int),\n'
- ' },\n'
- ' }));\n');
-
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' #j: const Declaration(#j, int),\n'
+ ' },\n'
+ ' }));\n');
});
test('only properties', () {
@@ -420,18 +360,14 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('A'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
-
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('fields, properties, and and methods', () {
@@ -439,22 +375,19 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('A'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' #inc0: const Declaration(#inc0, Function, kind: METHOD),\n'
- ' #inc1: const Declaration(#inc1, Function, kind: METHOD),\n'
- ' #inc2: const Declaration(#inc2, Function, kind: METHOD),\n'
- ' #j: const Declaration(#j, int),\n'
- ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' #inc0: const Declaration(#inc0, Function, kind: METHOD),\n'
+ ' #inc1: const Declaration(#inc1, Function, kind: METHOD),\n'
+ ' #inc2: const Declaration(#inc2, Function, kind: METHOD),\n'
+ ' #j: const Declaration(#j, int),\n'
+ ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('exclude inherited', () {
@@ -462,20 +395,17 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('D'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.D: {\n'
- ' #i2: const Declaration(#i2, int, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' #x2: const Declaration(#x2, int, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.D: {\n'
+ ' #i2: const Declaration(#i2, int, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' #x2: const Declaration(#x2, int, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' },\n'
+ ' }));\n');
});
test('include inherited', () {
@@ -483,117 +413,105 @@ main() {
var lib = provider.libraryFor('/common.dart');
recorder.runQuery(lib.getType('D'), options, includeAccessors: false);
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
+ imports: ["import '/common.dart' as smoke_0;",],
topLevel: 'abstract class _M0 {} // C & A\n',
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.D: _M0,\n'
- ' _M0: smoke_0.C,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.C: {\n'
- ' #b: const Declaration(#b, smoke_0.B),\n'
- ' #x: const Declaration(#x, int),\n'
- ' #y: const Declaration(#y, String),\n'
- ' },\n'
- ' smoke_0.D: {\n'
- ' #i2: const Declaration(#i2, int, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' #x2: const Declaration(#x2, int, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' },\n'
- ' _M0: {\n'
- ' #i: const Declaration(#i, int),\n'
- ' #j: const Declaration(#j, int),\n'
- ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
- ' },\n'
- ' }));\n');
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.D: _M0,\n'
+ ' _M0: smoke_0.C,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.C: {\n'
+ ' #b: const Declaration(#b, smoke_0.B),\n'
+ ' #x: const Declaration(#x, int),\n'
+ ' #y: const Declaration(#y, String),\n'
+ ' },\n'
+ ' smoke_0.D: {\n'
+ ' #i2: const Declaration(#i2, int, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' #x2: const Declaration(#x2, int, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' },\n'
+ ' _M0: {\n'
+ ' #i: const Declaration(#i, int),\n'
+ ' #j: const Declaration(#j, int),\n'
+ ' #j2: const Declaration(#j2, int, kind: PROPERTY),\n'
+ ' },\n'
+ ' }));\n');
});
test('exact annotation', () {
var lib = provider.libraryFor('/common.dart');
var vars = lib.definingCompilationUnit.topLevelVariables;
expect(vars[0].name, 'a1');
- var options = new QueryOptions(includeInherited: true,
- withAnnotations: [vars[0]]);
+ var options =
+ new QueryOptions(includeInherited: true, withAnnotations: [vars[0]]);
recorder.runQuery(lib.getType('H'), options, includeAccessors: false);
final annot = 'annotations: const [smoke_0.a1]';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.H: smoke_0.G,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.G: {\n'
- ' #b: const Declaration(#b, int, $annot),\n'
- ' },\n'
- ' smoke_0.H: {\n'
- ' #f: const Declaration(#f, int, $annot),\n'
- ' #g: const Declaration(#g, int, $annot),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.H: smoke_0.G,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.G: {\n'
+ ' #b: const Declaration(#b, int, $annot),\n'
+ ' },\n'
+ ' smoke_0.H: {\n'
+ ' #f: const Declaration(#f, int, $annot),\n'
+ ' #g: const Declaration(#g, int, $annot),\n'
+ ' },\n'
+ ' }));\n');
});
test('type annotation', () {
var lib = provider.libraryFor('/common.dart');
- var options = new QueryOptions(includeInherited: true,
- withAnnotations: [lib.getType('Annot')]);
+ var options = new QueryOptions(
+ includeInherited: true, withAnnotations: [lib.getType('Annot')]);
recorder.runQuery(lib.getType('H'), options, includeAccessors: false);
final a1Annot = 'annotations: const [smoke_0.a1]';
final a3Annot = 'annotations: const [smoke_0.a3]';
final exprAnnot = 'annotations: const [const smoke_0.Annot(1)]';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' parents: {\n'
- ' smoke_0.H: smoke_0.G,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.G: {\n'
- ' #b: const Declaration(#b, int, $a1Annot),\n'
- ' },\n'
- ' smoke_0.H: {\n'
- ' #f: const Declaration(#f, int, $a1Annot),\n'
- ' #g: const Declaration(#g, int, $a1Annot),\n'
- ' #i: const Declaration(#i, int, $a3Annot),\n'
- ' #j: const Declaration(#j, int, $exprAnnot),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' parents: {\n'
+ ' smoke_0.H: smoke_0.G,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.G: {\n'
+ ' #b: const Declaration(#b, int, $a1Annot),\n'
+ ' },\n'
+ ' smoke_0.H: {\n'
+ ' #f: const Declaration(#f, int, $a1Annot),\n'
+ ' #g: const Declaration(#g, int, $a1Annot),\n'
+ ' #i: const Declaration(#i, int, $a3Annot),\n'
+ ' #j: const Declaration(#j, int, $exprAnnot),\n'
+ ' },\n'
+ ' }));\n');
});
test('type annotation with named arguments', () {
var lib = provider.libraryFor('/common.dart');
- var options = new QueryOptions(includeInherited: true,
- withAnnotations: [lib.getType('AnnotC')]);
+ var options = new QueryOptions(
+ includeInherited: true, withAnnotations: [lib.getType('AnnotC')]);
recorder.runQuery(lib.getType('K'), options, includeAccessors: false);
final kAnnot = 'annotations: const [const smoke_0.AnnotC(named: true)]';
final k2Annot = 'annotations: const [const smoke_0.AnnotC()]';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.K: {\n'
- ' #k: const Declaration(#k, int, $kAnnot),\n'
- ' #k2: const Declaration(#k2, int, $k2Annot),\n'
- ' },\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.K: {\n'
+ ' #k: const Declaration(#k, int, $kAnnot),\n'
+ ' #k2: const Declaration(#k2, int, $k2Annot),\n'
+ ' },\n'
+ ' }));\n');
});
});
@@ -605,37 +523,34 @@ main() {
recorder.lookupMember(lib.getType('I'), 'i3');
recorder.lookupMember(lib.getType('I'), 'm4');
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' getters: {\n'
- ' #i1: (o) => o.i1,\n'
- ' #i2: (o) => o.i2,\n'
- ' #i3: (o) => o.i3,\n'
- ' #m4: (o) => o.m4,\n'
- ' },\n'
- ' setters: {\n' // #i3 is final
- ' #i1: (o, v) { o.i1 = v; },\n'
- ' #i2: (o, v) { o.i2 = v; },\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.I: {\n'
- ' #i1: const Declaration(#i1, dynamic),\n'
- ' #i2: const Declaration(#i2, dynamic, kind: PROPERTY),\n'
- ' #i3: const Declaration(#i3, smoke_0.G, kind: PROPERTY, '
- 'isFinal: true),\n'
- ' #m4: const Declaration(#m4, Function, kind: METHOD),\n'
- ' },\n'
- ' },\n'
- ' names: {\n'
- ' #i1: r\'i1\',\n'
- ' #i2: r\'i2\',\n'
- ' #i3: r\'i3\',\n'
- ' #m4: r\'m4\',\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' getters: {\n'
+ ' #i1: (o) => o.i1,\n'
+ ' #i2: (o) => o.i2,\n'
+ ' #i3: (o) => o.i3,\n'
+ ' #m4: (o) => o.m4,\n'
+ ' },\n'
+ ' setters: {\n' // #i3 is final
+ ' #i1: (o, v) { o.i1 = v; },\n'
+ ' #i2: (o, v) { o.i2 = v; },\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.I: {\n'
+ ' #i1: const Declaration(#i1, dynamic),\n'
+ ' #i2: const Declaration(#i2, dynamic, kind: PROPERTY),\n'
+ ' #i3: const Declaration(#i3, smoke_0.G, kind: PROPERTY, '
+ 'isFinal: true),\n'
+ ' #m4: const Declaration(#m4, Function, kind: METHOD),\n'
+ ' },\n'
+ ' },\n'
+ ' names: {\n'
+ ' #i1: r\'i1\',\n'
+ ' #i2: r\'i2\',\n'
+ ' #i3: r\'i3\',\n'
+ ' #m4: r\'m4\',\n'
+ ' }));\n');
});
test('static members', () {
@@ -646,79 +561,73 @@ main() {
final pDetails = 'kind: PROPERTY, isFinal: true, isStatic: true';
const mDetails = 'kind: METHOD, isStatic: true';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' declarations: {\n'
- ' smoke_0.A: {\n'
- ' #sI: const Declaration(#sI, int, isStatic: true),\n'
- ' #sJ: const Declaration(#sJ, int, $pDetails),\n'
- ' #sM: const Declaration(#sM, Function, $mDetails),\n'
- ' },\n'
- ' },\n'
- ' staticMethods: {\n'
- ' smoke_0.A: {\n'
- ' #sM: smoke_0.A.sM,\n'
- ' },\n'
- ' },\n'
- ' names: {\n'
- ' #sM: r\'sM\',\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.A: {\n'
+ ' #sI: const Declaration(#sI, int, isStatic: true),\n'
+ ' #sJ: const Declaration(#sJ, int, $pDetails),\n'
+ ' #sM: const Declaration(#sM, Function, $mDetails),\n'
+ ' },\n'
+ ' },\n'
+ ' staticMethods: {\n'
+ ' smoke_0.A: {\n'
+ ' #sM: smoke_0.A.sM,\n'
+ ' },\n'
+ ' },\n'
+ ' names: {\n'
+ ' #sM: r\'sM\',\n'
+ ' }));\n');
});
test('query', () {
var lib = provider.libraryFor('/common.dart');
- var options = new QueryOptions(includeInherited: true,
- withAnnotations: [lib.getType('Annot')]);
+ var options = new QueryOptions(
+ includeInherited: true, withAnnotations: [lib.getType('Annot')]);
recorder.runQuery(lib.getType('H'), options);
final a1Annot = 'annotations: const [smoke_0.a1]';
final a3Annot = 'annotations: const [smoke_0.a3]';
final exprAnnot = 'annotations: const [const smoke_0.Annot(1)]';
checkResults(generator,
- imports: [
- "import '/common.dart' as smoke_0;",
- ],
- initCall:
- 'useGeneratedCode(new StaticConfiguration(\n'
- ' checkedMode: false,\n'
- ' getters: {\n'
- ' #b: (o) => o.b,\n'
- ' #f: (o) => o.f,\n'
- ' #g: (o) => o.g,\n'
- ' #i: (o) => o.i,\n'
- ' #j: (o) => o.j,\n'
- ' },\n'
- ' setters: {\n' // #i3 is final
- ' #b: (o, v) { o.b = v; },\n'
- ' #f: (o, v) { o.f = v; },\n'
- ' #g: (o, v) { o.g = v; },\n'
- ' #i: (o, v) { o.i = v; },\n'
- ' #j: (o, v) { o.j = v; },\n'
- ' },\n'
- ' parents: {\n'
- ' smoke_0.H: smoke_0.G,\n'
- ' },\n'
- ' declarations: {\n'
- ' smoke_0.G: {\n'
- ' #b: const Declaration(#b, int, $a1Annot),\n'
- ' },\n'
- ' smoke_0.H: {\n'
- ' #f: const Declaration(#f, int, $a1Annot),\n'
- ' #g: const Declaration(#g, int, $a1Annot),\n'
- ' #i: const Declaration(#i, int, $a3Annot),\n'
- ' #j: const Declaration(#j, int, $exprAnnot),\n'
- ' },\n'
- ' },\n'
- ' names: {\n'
- ' #b: r\'b\',\n'
- ' #f: r\'f\',\n'
- ' #g: r\'g\',\n'
- ' #i: r\'i\',\n'
- ' #j: r\'j\',\n'
- ' }));\n');
+ imports: ["import '/common.dart' as smoke_0;",],
+ initCall: 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' getters: {\n'
+ ' #b: (o) => o.b,\n'
+ ' #f: (o) => o.f,\n'
+ ' #g: (o) => o.g,\n'
+ ' #i: (o) => o.i,\n'
+ ' #j: (o) => o.j,\n'
+ ' },\n'
+ ' setters: {\n' // #i3 is final
+ ' #b: (o, v) { o.b = v; },\n'
+ ' #f: (o, v) { o.f = v; },\n'
+ ' #g: (o, v) { o.g = v; },\n'
+ ' #i: (o, v) { o.i = v; },\n'
+ ' #j: (o, v) { o.j = v; },\n'
+ ' },\n'
+ ' parents: {\n'
+ ' smoke_0.H: smoke_0.G,\n'
+ ' },\n'
+ ' declarations: {\n'
+ ' smoke_0.G: {\n'
+ ' #b: const Declaration(#b, int, $a1Annot),\n'
+ ' },\n'
+ ' smoke_0.H: {\n'
+ ' #f: const Declaration(#f, int, $a1Annot),\n'
+ ' #g: const Declaration(#g, int, $a1Annot),\n'
+ ' #i: const Declaration(#i, int, $a3Annot),\n'
+ ' #j: const Declaration(#j, int, $exprAnnot),\n'
+ ' },\n'
+ ' },\n'
+ ' names: {\n'
+ ' #b: r\'b\',\n'
+ ' #f: r\'f\',\n'
+ ' #g: r\'g\',\n'
+ ' #i: r\'i\',\n'
+ ' #j: r\'j\',\n'
+ ' }));\n');
});
});
}
@@ -749,7 +658,6 @@ const _SOURCES = const {
int f1;
}
''',
-
'/b.dart': '''
library b;
« no previous file with comments | « test/codegen/generator_test.dart ('k') | test/codegen/testing_resolver_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698