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

Unified Diff: tests/lib_strong/mirrors/invoke_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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: tests/lib_strong/mirrors/invoke_test.dart
diff --git a/tests/lib_strong/mirrors/invoke_test.dart b/tests/lib_strong/mirrors/invoke_test.dart
index ec5056f38790113b40d5a2f534fd1329a8d9e703..b86a969c9951ad30660195574c69e737945cf59f 100644
--- a/tests/lib_strong/mirrors/invoke_test.dart
+++ b/tests/lib_strong/mirrors/invoke_test.dart
@@ -31,7 +31,7 @@ class C {
var libraryField = 'a priori';
get libraryGetter => 'lget $libraryField';
set librarySetter(v) => libraryField = 'lset $v';
-libraryFunction(x,y) => '$x$y';
+libraryFunction(x, y) => '$x$y';
bool isNoSuchMethodError(e) {
return e is NoSuchMethodError;
@@ -43,11 +43,11 @@ testSync() {
// InstanceMirror invoke
C c = new C();
InstanceMirror im = reflect(c);
- result = im.invoke(const Symbol('method'), [2,4,8]);
+ result = im.invoke(const Symbol('method'), [2, 4, 8]);
Expect.equals('2+4+8', result.reflectee);
- result = im.invoke(const Symbol('doesntExist'), [2,4,8]);
+ result = im.invoke(const Symbol('doesntExist'), [2, 4, 8]);
Expect.equals('DNU', result.reflectee);
- result = im.invoke(const Symbol('method'), [2,4]); // Wrong arity.
+ result = im.invoke(const Symbol('method'), [2, 4]); // Wrong arity.
Expect.equals('DNU', result.reflectee);
// InstanceMirror invokeGetter
@@ -72,14 +72,12 @@ testSync() {
// ClassMirror invoke
ClassMirror cm = reflectClass(C);
- result = cm.invoke(const Symbol('staticFunction'),[3,4]);
+ result = cm.invoke(const Symbol('staticFunction'), [3, 4]);
Expect.equals('(3,4)', result.reflectee);
- Expect.throws(() => cm.invoke(const Symbol('doesntExist'),[3,4]),
- isNoSuchMethodError,
- 'Not defined');
- Expect.throws(() => cm.invoke(const Symbol('staticFunction'),[3]),
- isNoSuchMethodError,
- 'Wrong arity');
+ Expect.throws(() => cm.invoke(const Symbol('doesntExist'), [3, 4]),
+ isNoSuchMethodError, 'Not defined');
+ Expect.throws(() => cm.invoke(const Symbol('staticFunction'), [3]),
+ isNoSuchMethodError, 'Wrong arity');
// ClassMirror invokeGetter
result = cm.getField(const Symbol('staticGetter'));
@@ -87,22 +85,20 @@ testSync() {
result = cm.getField(const Symbol('staticField'));
Expect.equals('initial', result.reflectee);
Expect.throws(() => cm.getField(const Symbol('doesntExist')),
- isNoSuchMethodError,
- 'Not defined');
+ isNoSuchMethodError, 'Not defined');
// ClassMirror invokeSetter
result = cm.setField(const Symbol('staticSetter'), 'sfoo');
Expect.equals('sfoo', result.reflectee);
Expect.equals('sset sfoo', C.staticField);
- Expect.equals('sset sfoo',
- cm.getField(const Symbol('staticField')).reflectee);
+ Expect.equals(
+ 'sset sfoo', cm.getField(const Symbol('staticField')).reflectee);
result = cm.setField(const Symbol('staticField'), 'sbar');
Expect.equals('sbar', result.reflectee);
Expect.equals('sbar', C.staticField);
Expect.equals('sbar', cm.getField(const Symbol('staticField')).reflectee);
Expect.throws(() => cm.setField(const Symbol('doesntExist'), 'sbar'),
- isNoSuchMethodError,
- 'Not defined');
+ isNoSuchMethodError, 'Not defined');
// ClassMirror invokeConstructor
result = cm.newInstance(const Symbol(''), []);
@@ -112,22 +108,18 @@ testSync() {
Expect.isTrue(result.reflectee is C);
Expect.equals('my value', result.reflectee.field);
Expect.throws(() => cm.newInstance(const Symbol('doesntExist'), ['my value']),
- isNoSuchMethodError,
- 'Not defined');
+ isNoSuchMethodError, 'Not defined');
Expect.throws(() => cm.newInstance(const Symbol('named'), []),
- isNoSuchMethodError,
- 'Wrong arity');
+ isNoSuchMethodError, 'Wrong arity');
// LibraryMirror invoke
LibraryMirror lm = cm.owner;
- result = lm.invoke(const Symbol('libraryFunction'),[':',')']);
+ result = lm.invoke(const Symbol('libraryFunction'), [':', ')']);
Expect.equals(':)', result.reflectee);
- Expect.throws(() => lm.invoke(const Symbol('doesntExist'), [':',')']),
- isNoSuchMethodError,
- 'Not defined');
+ Expect.throws(() => lm.invoke(const Symbol('doesntExist'), [':', ')']),
+ isNoSuchMethodError, 'Not defined');
Expect.throws(() => lm.invoke(const Symbol('libraryFunction'), [':']),
- isNoSuchMethodError,
- 'Wrong arity');
+ isNoSuchMethodError, 'Wrong arity');
// LibraryMirror invokeGetter
result = lm.getField(const Symbol('libraryGetter'));
@@ -135,22 +127,20 @@ testSync() {
result = lm.getField(const Symbol('libraryField'));
Expect.equals('a priori', result.reflectee);
Expect.throws(() => lm.getField(const Symbol('doesntExist')),
- isNoSuchMethodError,
- 'Not defined');
+ isNoSuchMethodError, 'Not defined');
// LibraryMirror invokeSetter
result = lm.setField(const Symbol('librarySetter'), 'lfoo');
Expect.equals('lfoo', result.reflectee);
Expect.equals('lset lfoo', libraryField);
- Expect.equals('lset lfoo',
- lm.getField(const Symbol('libraryField')).reflectee);
+ Expect.equals(
+ 'lset lfoo', lm.getField(const Symbol('libraryField')).reflectee);
result = lm.setField(const Symbol('libraryField'), 'lbar');
Expect.equals('lbar', result.reflectee);
Expect.equals('lbar', libraryField);
Expect.equals('lbar', lm.getField(const Symbol('libraryField')).reflectee);
Expect.throws(() => lm.setField(const Symbol('doesntExist'), 'lbar'),
- isNoSuchMethodError,
- 'Not defined');
+ isNoSuchMethodError, 'Not defined');
}
main() {

Powered by Google App Engine
This is Rietveld 408576698