Index: tests/lib/mirrors/invoke_test.dart |
diff --git a/tests/lib/mirrors/invoke_test.dart b/tests/lib/mirrors/invoke_test.dart |
index 273b3cd0cd7d6570d32979b432733ab8fbdb5ac3..ca886c13c48dfc20721b28f3532bf25b7c6da349 100644 |
--- a/tests/lib/mirrors/invoke_test.dart |
+++ b/tests/lib/mirrors/invoke_test.dart |
@@ -32,7 +32,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; |
@@ -44,11 +44,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 |
@@ -73,14 +73,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')); |
@@ -88,22 +86,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(''), []); |
@@ -113,22 +109,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')); |
@@ -136,22 +128,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() { |