Chromium Code Reviews| Index: tests/lib/mirrors/reflect_class_test.dart |
| diff --git a/tests/lib/mirrors/reflect_class_test.dart b/tests/lib/mirrors/reflect_class_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ab2818473948e3699009bf46f3287c14412a0ea6 |
| --- /dev/null |
| +++ b/tests/lib/mirrors/reflect_class_test.dart |
| @@ -0,0 +1,21 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "dart:mirrors"; |
| + |
| +import "package:expect/expect.dart"; |
| + |
| +typedef void FooFunction(int a, double b); |
| + |
| +main() { |
| + Function expectedError = (e) => e is ArgumentError; |
| + |
| + Expect.throws(() => reflectClass(dynamic), expectedError); |
| + Expect.throws(() => reflectClass(1), expectedError); |
|
rmacnak
2013/09/18 22:52:06
These checks fail with TypeErrors in checked mode.
|
| + Expect.throws(() => reflectClass("string"), expectedError); |
| + |
| + // reflectClass() on a function type should fail once typedefs are represented |
| + // by TypedefMirrors instead of ClassMirrors. |
| + // Expect.throws(() => reflectClass(FooFunction), expectedError); |
| +} |