Index: tests/compiler/dart2js_extra/deferred/deferred_class_test.dart |
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart |
index 1486e75fe0718fcd845e4a30e46bf08e23c2f1b3..c3ec28a70cd058adfc248d51d669bc556fba6270 100644 |
--- a/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart |
+++ b/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart |
@@ -10,6 +10,24 @@ const lazy = const DeferredLibrary('deferred_class_library'); |
isNoSuchMethodError(e) => e is NoSuchMethodError; |
+class Expect { |
+ static void isTrue(x) => expect.equals(true, x); |
+ static void equals(expected, actual) { |
+ if (expected != actual) { |
+ throw "Not equal. Expected: $expected. Got: $actual"; |
+ } |
+ } |
+ static void throws(fun, [test]) { |
+ try { |
+ fun(); |
+ } catch (e) { |
+ if (!test(e)) throw "doesn't satisfy exception test"; |
+ return; |
+ } |
+ throw "didn't throw"; |
+ } |
+} |
+ |
main() { |
var x; |
Expect.throws(() { x = new MyClass(); }, isNoSuchMethodError); |