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

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

Issue 2975253002: Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt. (Closed)
Patch Set: Created 3 years, 5 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/src/summary/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index 38796c203823736d90caf85d085c37faea3d34e5..699811cdec2f2fca97f56d332c740f83c13a5ad1 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -199,18 +199,14 @@ class C extends B {
}
void test_bundle_refers_to_bundle() {
- var bundle1 = createPackageBundle(
- '''
+ var bundle1 = createPackageBundle('''
var x = 0;
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle1);
- var bundle2 = createPackageBundle(
- '''
+ var bundle2 = createPackageBundle('''
import "a.dart";
var y = x;
-''',
- path: '/b.dart');
+''', path: '/b.dart');
expect(bundle2.dependencies, hasLength(1));
expect(bundle2.dependencies[0].summaryPath, '/a.ds');
expect(bundle2.dependencies[0].apiSignature, bundle1.apiSignature);
@@ -266,16 +262,14 @@ class B<T> extends A<T> {
}
void test_createPackageBundle_withPackageUri() {
- PackageBundle bundle = createPackageBundle(
- '''
+ PackageBundle bundle = createPackageBundle('''
class B {
void f(int i) {}
}
class C extends B {
f(i) {} // Inferred param type: int
}
-''',
- uri: 'package:foo/bar.dart');
+''', uri: 'package:foo/bar.dart');
UnlinkedExecutable cf = bundle.unlinkedUnits[0].classes[1].executables[0];
UnlinkedParam cfi = cf.parameters[0];
expect(cfi.inferredTypeSlot, isNot(0));
@@ -314,11 +308,9 @@ class C extends B {
}
void test_inferredType_closure_fromBundle() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
var x = () {};
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -330,8 +322,7 @@ var y = x;
}
void test_inferredType_closure_fromBundle_identifierSequence() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class C {
static final x = (D d) => d.e;
}
@@ -339,8 +330,7 @@ class D {
E e;
}
class E {}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -352,16 +342,14 @@ var y = C.x;
}
void test_inferredType_implicitFunctionTypeIndices() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class A {
void foo(void bar(int arg)) {}
}
class B extends A {
void foo(bar) {}
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -459,13 +447,11 @@ class C extends B {
}
void test_inferredType_parameter_genericFunctionType() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class A<T> {
A<R> map<R>(R Function(T) f) => null;
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -516,12 +502,10 @@ var y = x;
}
void test_inferredTypeFromOutsideBuildUnit_dynamic() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
var x;
var y = x; // Inferred type: dynamic
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -533,13 +517,11 @@ var z = y; // Inferred type: dynamic
}
void test_inferredTypeFromOutsideBuildUnit_instanceField() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class C {
var f = 0; // Inferred type: int
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -551,13 +533,11 @@ var x = new C().f; // Inferred type: dynamic
}
void test_inferredTypeFromOutsideBuildUnit_instanceField_toInstanceField() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class C {
var f = 0; // Inferred type: int
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -571,16 +551,14 @@ class D {
}
void test_inferredTypeFromOutsideBuildUnit_methodParamType_viaInheritance() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class B {
void f(int i) {}
}
class C extends B {
f(i) {} // Inferred param type: int
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -598,16 +576,14 @@ class D extends C {
}
void test_inferredTypeFromOutsideBuildUnit_methodReturnType_viaCall() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class B {
int f() => 0;
}
class C extends B {
f() => 1; // Inferred return type: int
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
@@ -619,16 +595,14 @@ var x = new C().f(); // Inferred type: int
}
void test_inferredTypeFromOutsideBuildUnit_methodReturnType_viaInheritance() {
- var bundle = createPackageBundle(
- '''
+ var bundle = createPackageBundle('''
class B {
int f() => 0;
}
class C extends B {
f() => 1; // Inferred return type: int
}
-''',
- path: '/a.dart');
+''', path: '/a.dart');
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
« no previous file with comments | « pkg/analyzer/test/src/dart/sdk/sdk_test.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698