Index: tests/lib/mirrors/invoke_throws_test.dart |
diff --git a/tests/lib/mirrors/invoke_throws_test.dart b/tests/lib/mirrors/invoke_throws_test.dart |
index 51ce357bc5c328ae4d89ed35c60cc16c03131f0a..a67e29058e24372d967870358fb2448ae0e53cfe 100644 |
--- a/tests/lib/mirrors/invoke_throws_test.dart |
+++ b/tests/lib/mirrors/invoke_throws_test.dart |
@@ -9,63 +9,83 @@ import 'dart:mirrors'; |
import 'package:expect/expect.dart'; |
-class MyException { |
-} |
+class MyException {} |
class Class { |
Class.noException(); |
- Class.generative() { throw new MyException(); } |
+ Class.generative() { |
+ throw new MyException(); |
+ } |
Class.redirecting() : this.generative(); |
- factory Class.faktory() { throw new MyException(); } |
+ factory Class.faktory() { |
+ throw new MyException(); |
+ } |
factory Class.redirectingFactory() = Class.faktory; |
- get getter { throw new MyException(); } |
- set setter(v) { throw new MyException(); } |
- method() { throw new MyException(); } |
- |
- noSuchMethod(invocation) { throw new MyException(); } |
+ get getter { |
+ throw new MyException(); |
+ } |
+ |
+ set setter(v) { |
+ throw new MyException(); |
+ } |
+ |
+ method() { |
+ throw new MyException(); |
+ } |
+ |
+ noSuchMethod(invocation) { |
+ throw new MyException(); |
+ } |
+ |
+ static get staticGetter { |
+ throw new MyException(); |
+ } |
+ |
+ static set staticSetter(v) { |
+ throw new MyException(); |
+ } |
- static get staticGetter { throw new MyException(); } |
- static set staticSetter(v) { throw new MyException(); } |
- static staticFunction() { throw new MyException(); } |
+ static staticFunction() { |
+ throw new MyException(); |
+ } |
} |
-get libraryGetter { throw new MyException(); } |
-set librarySetter(v) { throw new MyException(); } |
-libraryFunction() { throw new MyException(); } |
+get libraryGetter { |
+ throw new MyException(); |
+} |
+ |
+set librarySetter(v) { |
+ throw new MyException(); |
+} |
+ |
+libraryFunction() { |
+ throw new MyException(); |
+} |
main() { |
InstanceMirror im = reflect(new Class.noException()); |
- Expect.throws(() => im.getField(#getter), |
- (e) => e is MyException); |
- Expect.throws(() => im.setField(#setter, ['arg']), |
- (e) => e is MyException); |
- Expect.throws(() => im.invoke(#method, []), |
- (e) => e is MyException); |
- Expect.throws(() => im.invoke(#triggerNoSuchMethod, []), |
- (e) => e is MyException); |
+ Expect.throws(() => im.getField(#getter), (e) => e is MyException); |
+ Expect.throws(() => im.setField(#setter, ['arg']), (e) => e is MyException); |
+ Expect.throws(() => im.invoke(#method, []), (e) => e is MyException); |
+ Expect.throws( |
+ () => im.invoke(#triggerNoSuchMethod, []), (e) => e is MyException); |
ClassMirror cm = reflectClass(Class); |
- Expect.throws(() => cm.getField(#staticGetter), |
- (e) => e is MyException); |
- Expect.throws(() => cm.setField(#staticSetter, ['arg']), |
- (e) => e is MyException); |
- Expect.throws(() => cm.invoke(#staticFunction, []), |
- (e) => e is MyException); |
- Expect.throws(() => cm.newInstance(#generative, []), |
- (e) => e is MyException); |
- Expect.throws(() => cm.newInstance(#redirecting, []), |
- (e) => e is MyException); |
- Expect.throws(() => cm.newInstance(#faktory, []), |
- (e) => e is MyException); |
- Expect.throws(() => cm.newInstance(#redirectingFactory, []), |
- (e) => e is MyException); |
+ Expect.throws(() => cm.getField(#staticGetter), (e) => e is MyException); |
+ Expect.throws( |
+ () => cm.setField(#staticSetter, ['arg']), (e) => e is MyException); |
+ Expect.throws(() => cm.invoke(#staticFunction, []), (e) => e is MyException); |
+ Expect.throws(() => cm.newInstance(#generative, []), (e) => e is MyException); |
+ Expect.throws( |
+ () => cm.newInstance(#redirecting, []), (e) => e is MyException); |
+ Expect.throws(() => cm.newInstance(#faktory, []), (e) => e is MyException); |
+ Expect.throws( |
+ () => cm.newInstance(#redirectingFactory, []), (e) => e is MyException); |
LibraryMirror lm = reflectClass(Class).owner; |
- Expect.throws(() => lm.getField(#libraryGetter), |
- (e) => e is MyException); |
- Expect.throws(() => lm.setField(#librarySetter, ['arg']), |
- (e) => e is MyException); |
- Expect.throws(() => lm.invoke(#libraryFunction, []), |
- (e) => e is MyException); |
+ Expect.throws(() => lm.getField(#libraryGetter), (e) => e is MyException); |
+ Expect.throws( |
+ () => lm.setField(#librarySetter, ['arg']), (e) => e is MyException); |
+ Expect.throws(() => lm.invoke(#libraryFunction, []), (e) => e is MyException); |
} |